Applet

End Tag: Required
Support Key: 2 | 3 | 3.2 | 4 | IE3B2 | M | N2 | O
What is it?
Attributes
Tag Example
Parent/Content Model
Tips & Tricks
Browser Peculiarities
= Index DOT Html by Brian Wilson [bloo@blooberry.com] =
Main Index | Element Tree | Element Index | HTML Support History


What is it?
The APPLET element is the mechanism to embed and invoke a Java application within an HTML document. A browser that understands this element will ignore everything in the content of the APPLET element except for embedded PARAM elements [which are used to pass parameters to the Applet.] Browsers that do not understand this element should ignore it and the embedded PARAM elements and process the content between the begin and end APPLET tags instead (this should also happen when the Applet fails to load for whatever reason.)

Common Attributes
%Core%
2 | 3 | 3.2 | 4 | IE | M | N4 | O
%Events%
2 | 3 | 3.2 | 4 | IE | M | N | O
%Language%
2 | 3 | 3.2 | 4 | IE4 | M | N | O

Specific Attributes
Align
2 | 3 | 3.2 | 4 | IE3B2 | M | N2 | O
Required? No
Description:
This attribute specifies the alignment of text following the APPLET reference relative to the applet on screen. LEFT and RIGHT specify floating horizontal alignment of the applet in the browser window, and subsequent text will wrap around the applet. The other options specify vertical alignment of text relative to the applet on the same line.
Values:
    Left | Right | Top | Texttop | Middle | Textmiddle | Baseline | Bottom | Textbottom
Alt
2 | 3 | 3.2 | 4 | IE3B2 | M | N2 | O
Required? No
Description:
This attribute indicates text to be displayed for text only browsers or browsers that do not understand the Applet element [I am not sure why this attribute exists if the same holds true for all APPLET element content.]
Values: Alphanumeric characters
Archive
2 | 3 | 3.2 | 4 | IE | M | N3B7 | O
Required? No
Description:
Verbatim from Netscape:
"This attribute can improve applet download time by reducing the number of HTTP connections required to fetch applet code. Example:
<applet ARCHIVE="Nuclear.zip" CODE="NuclearPlant.class" WIDTH=500 HEIGHT=500>
</applet>
This will cause the file Nuclear.zip to be downloaded to the user's disk, and will search it for the NuclearPlant class and the classes it requires. The zip file is found relative to the codebase path, and must not be compressed. Classes not in the zip file will still be searched for via the old mechanism if required."
[Note about Applet archiving: Java uses the GNU-ZIP .ZIP format with compression turned off in order to store class libraries.]
Values: An absolute or relative URL
Code
2 | 3 | 3.2 | 4 | IE3B2 | M | N2 | O
Required? Yes
Description:
This attribute indicates a URL pointing to the Applet's code/class.
Values: An absolute or relative URL.
CodeBase
2 | 3 | 3.2 | 4 | IE3B2 | M | N2 | O
Required? No
Description:
This attribute indicates the base URL of the applet if the CODE attribute is relative. If the CODEBASE URL is relative, it is in relation to the current document URL or the BASE HREF element, if present.
Values: An absolute or relative URL.
Height
2 | 3 | 3.2 | 4 | IE3B2 | M | N2 | O
Required? Yes
Description:
This attribute explicitly specifies the height of the applet in pixels. It can be used to speed up display of the document being downloaded so it can pre-render the document with an applet placeholder while the applet downloads.
Values: Positive integers
HSpace
2 | 3 | 3.2 | 4 | IE3B2 | M | N2 | O
Required? No
Description:
This attribute specifies the horizontal spacing (left and right padding) around the applet in pixels.
Values: Positive integers
Mayscript
2 | 3 | 3.2 | 4 | IE | M | N3 | O
Required? No
Description:
This is a stand-alone attribute which permits the applet to access Javascript functionality and data on a page. Attempts to access Javascript when this attribute is not present results in a Java exception.
Values: NA
Name
2 | 3 | 3.2 | 4 | IE3B2 | M | N2 | O
Required? No
Description:
This provides a way for the applet to identify the applet to other applets in the current HTML page.
Values: Alphanumeric characters
Object
2 | 3 | 3.2 | 4 | IE | M | N | O
Required? No
Description:
"This attribute gives the name of the resource that contains a 'serialized' representation of an applet. The applet will be deserialized by the browser. The init() method will not be invoked; but its start() method will. Attributes valid when the original object was serialized are not restored. Any attributes passed to this applet instance will be available to the Applet."
Values: Alphanumeric characters
Src
2 | 3 | 3.2 | 4 | IE4 | M | N | O
Required? No
Description:
Indicates an external URL reference to an applet. (this ability is also covered with the CODE and CODEBASE attributes)
Values: Either an absolute or relative URL.
VSpace
2 | 3 | 3.2 | 4 | IE3B2 | M | N2 | O
Required? No
Description:
This attribute specifies the vertical spacing (top and bottom padding) around the applet in pixels.
Values: Positive integers
Width
2 | 3 | 3.2 | 4 | IE3B2 | M | N2 | O
Required? Yes
Description:
This attribute explicitly specifies the width of the applet in pixels. It can be used to speed up display of the document being downloaded so it can pre-render the document with an applet placeholder while the applet downloads.
Values: Positive integers
Example
<applet CODEBASE="http://www.foo.com/java/" CODE="javaexample.class" WIDTH=200 HEIGHT=300>
   <param NAME=text1 VALUE="Example Text 1">
   <param NAME=imagecaption VALUE="Image Caption">
   <param NAME=bounceimage VALUE="bounce1.gif">
   <img SRC="non_java_image.gif" WIDTH=200 HEIGHT=300 BORDER=0 ALT="You are missing the full Java Experience.">
</applet>
Parent Model
%In-line Parent% | %Block Parent%
Content Model
%In-line Content% | %Block Content% | <param>
Tips & Tricks Browser Peculiarities
Boring Copyright Stuff...