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.)
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:
<appletARCHIVE="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
<appletCODEBASE="http://www.foo.com/java/"
CODE="javaexample.class"
WIDTH=200 HEIGHT=300>
<paramNAME=text1
VALUE="Example Text 1">
<paramNAME=imagecaption
VALUE="Image
Caption">
<paramNAME=bounceimage
VALUE="bounce1.gif">
<imgSRC="non_java_image.gif"
WIDTH=200 HEIGHT=300
BORDER=0 ALT="You
are missing the full Java Experience.">
</applet>
This element replaces the older APP element that was also used in
several browsers to include JAVA Applets.
The new OBJECT element created by the W3C
absorbs all of the functionality of the APPLET element. Currently, only
Internet Explorer supports it, so the safer element to use it still APPLET.
This will change in the future however.
Browser Peculiarities
The Internet Explorer 3.0 online tag reference lists support for
the TITLE attribute for this element. IE3 shows no signs that it
actually supports this.
Internet Explorer supports a compressed code technology for Java
similar to the intent of the ARCHIVE attribute. This scheme uses
Microsoft's Cabinet archiving format. CABBASE is used as an applet
parameter to indicate the location of the compressed file.
Problem: Internet Explorer does not appear to
use the CODE or CODEBASE attributes as fallback data sources for the
applet code if the CABBASE URL is invalid or unavailable.