APPLET (Java Applets)

Requires start and end tags. This element is supported by all Java enabled browsers. It allows you to embed a Java applet into HTML documents. APPLET uses associated PARAM elements to pass parameters to the applet. Following the PARAM elements, the content of APPLET elements should be used to provide an alternative to the applet for user agents that don't support Java. It is restricted to text-level markup as defined by the %text entity in the DTD. Java-compatible browsers ignore this extra HTML code. You can use it to show a snapshot of the applet running, with text explaining what the applet does. Other possibilities for this area are a link to a page that is more useful for the Java-ignorant browser, or text that taunts the user for not having a Java-compatible browser.

Here is a simple example of a Java applet:

	<applet code="Bubbles.class" width=500 height=500>
	Java applet that draws animated bubbles.
	</applet>

Here is another one using a PARAM element:

	<applet code="AudioItem" width=15 height=15>
	<param name=snd value="Hello.au|Welcome.au">
	Java applet that plays a welcoming sound.
	</applet>
codebase = codebaseURL
This optional attribute specifies the base URL of the applet -- the directory or folder that contains the applet's code. If this attribute is not specified, then the document's URL is used.

code = appletFile
This required attribute gives the name of the file that contains the applet's compiled Applet subclass. This file is relative to the base URL of the applet. It cannot be absolute.

alt = alternateText
This optional attribute specifies any text that should be displayed if the browser understands the APPLET tag but can't run Java applets.

name = appletInstanceName
This optional attribute specifies a name for the applet instance, which makes it possible for applets on the same page to find (and communicate with) each other.

width = pixels
height = pixels
These required attributes give the initial width and height (in pixels) of the applet display area, not counting any windows or dialogs that the applet brings up.

archive = uri-list
This attribute specifies a comma-separated list of URIs for archives containing classes and other resources that will be "preloaded". The classes are loaded using an instance of an AppletClassLoader with the given codebase. Relative URIs for archives are interpreted with respect to the applet's codebase. Preloading resources can significantly improve the performance of applets.

object = cdata
This attribute names a resource containing a serialized representation of an applet's state. It is interpreted relative to the applet's codebase. The serialized data contains the applet's class name but not the implementation. The class name is used to retrieve the implementation from a class file or archive. When the applet is "deserialized" the start() method is invoked but not the init() method. Attributes valid when the original object was serialized are not restored. Any attributes passed to this APPLET instance will be available to the applet. Authors should use this feature with extreme caution. An applet should be stopped before it is serialized. Either code or object must be present. If both code and object are given, it is an error if they provide different class names.

align = alignment
This attribute specifies the alignment of the applet. This attribute is defined in exactly the same way as the IMG element. The permitted values are: top, middle, bottom, left and right. The default is bottom.

vspace = pixels
hspace = pixels
These optional attributes specify the number of pixels above and below the applet (VSPACE) and on each side of the applet (HSPACE). They're treated the same way as the IMG element's VSPACE and HSPACE attributes.

The PARAM element is used to pass named parameters to applet:

   <PARAM NAME = appletParameter VALUE = value>

PARAM elements are the only way to specify applet-specific parameters. Applets read user-specified values for parameters with the getParameter() method.

name = applet parameter name
value = parameter value

SGML character entities such as &eacute; and &#185; are expanded before the parameter value is passed to the applet. To include an & character use &amp;.

Note: PARAM elements should be placed at the start of the content for the APPLET element. This is not specified as part of the DTD due to technicalities with SGML mixed content models.