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.)
Standards Details:
Deprecated in HTML 4.x/XHTML 1.0. Dropped in XHTML 1.1 in favor of OBJECT element.
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]
[X1|X1.1]
[IE3B2|M|N2|O]
Standards Details:
Deprecated in HTML 4.x/XHTML 1.0. Dropped in XHTML 1.1 in favor of OBJECT element.
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.]
Standards Details:
Deprecated in HTML 4.x/XHTML 1.0. Dropped in XHTML 1.1 in favor of OBJECT element.
Required? No
Description:
This attribute specifies an archive file containing the classes
necessary for the applet. The archive file URL is relative to the CODEBASE
URL path. Classes not in the zip file will still be searched for via
the other attribute methods available, if required.
Values:CDATA.
[An absolute or relative URL to a GNU-ZIP .ZIP format file. All URLs should be URL encoded where required.]
Description:
This SHOULD control the pixel thickness of a border around the applet
if it was to behave the way other elements carrying a BORDER attribute
behave. Instead, it just appears to render a padding around the APPLET
with the designated value being the amount of pixel padding around the
APPLET.
Values:0, for no border, or a positive integer pixel value.
Code
[2|3|3.2|4]
[X1|X1.1]
[IE3B2|M|N2|O3.5]
Standards Details:
Deprecated in HTML 4.x/XHTML 1.0. Dropped in XHTML 1.1 in favor of OBJECT element.
Required? Yes
Description:
This attribute indicates a URL pointing to the Applet's code/class.
Values:CDATA.
[Either an absolute or relative URL. All URLs should be URL encoded where required.]
CodeBase
[2|3|3.2|4]
[X1|X1.1]
[IE3B2|M|N2|O]
Standards Details:
Deprecated in HTML 4.x/XHTML 1.0. Dropped in XHTML 1.1 in favor of OBJECT element.
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:CDATA.
[Either an absolute or relative URL. All URLs should be URL encoded where required.]
Height
[2|3|3.2|4]
[X1|X1.1]
[IE3B2|M|N2|O3.5]
Standards Details:
Deprecated in HTML 4.x/XHTML 1.0. Dropped in XHTML 1.1 in favor of OBJECT element.
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:CDATA.
[Positive integers or positive integers followed by a "%" representing a percentage length]
HSpace
[2|3|3.2|4]
[X1|X1.1]
[IE3B2|M|N2|O4]
Standards Details:
Deprecated in HTML 4.x/XHTML 1.0. Dropped in XHTML 1.1 in favor of OBJECT element.
Required? No
Description:
This attribute specifies the horizontal spacing (left and right padding)
around the applet in pixels.
Values:0, for no horizontal padding, or a positive integer pixel value.
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]
[X1|X1.1]
[IE3B2|M|N2|O3.5]
Standards Details:
Deprecated in HTML 4.x/XHTML 1.0. Dropped in XHTML 1.1 in favor of OBJECT element.
Required? No
Description:
This provides a way for the applet to identify itself to other
applets in the current HTML page.
Standards Details:
Deprecated in HTML 4.x/XHTML 1.0. Dropped in XHTML 1.1 in favor of OBJECT element.
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."
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. All URLs should be URL encoded where required.
VSpace
[2|3|3.2|4]
[X1|X1.1]
[IE3B2|M|N2|O4]
Standards Details:
Deprecated in HTML 4.x/XHTML 1.0. Dropped in XHTML 1.1 in favor of OBJECT element.
Required? No
Description:
This attribute specifies the vertical spacing (top and bottom padding)
around the applet in pixels.
Values:0, for no vertical padding, or a positive integer pixel value.
Width
[2|3|3.2|4]
[X1|X1.1]
[IE3B2|M|N2|O3.5]
Standards Details:
Deprecated in HTML 4.x/XHTML 1.0. Dropped in XHTML 1.1 in favor of OBJECT element.
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:CDATA.
[Positive integers or positive integers followed by a "%" representing a percentage length]
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 OBJECT element absorbs all of the functionality
of the APPLET element. Historic support for APPLET is greater, but it is
no longer in XHTML DTDs. Choose the element as it is appropriate to your audience.
HTML 4.x+ recommends that authors use the ID attribute instead of the NAME
attribute wherever possible. ID is the accepted method moving forward and NAME will
eventually be removed.
Browser Peculiarities
The Internet Explorer online tag reference in the IE 3.0 timeframe
listed support for the TITLE attribute for this element. IE3 never
showed any signs that it actually supported 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.
Netscape 3.0 uses the GNU-ZIP format for the ARCHIVE attribute, but
they must be archived with compression turned off, or else this
attribute will fail. IE4+ and Netscape 4+ do allow zip file
compression for this attribute.
[Test]
Linefeed and Carriage Return handling ( and
respectively) for the ALT attribute:
- Internet Explorer: All literal/unencoded or
encoded CR/LFs are maintained and displayed as intended.
- Netscape: All unencoded or encoded CR/LFs are
collapsed to nothing in ALT display (not the normal method for
spacing-character collapsing - usually it would collapse to a
single space.)
[Test]
A bad bug exists in the Netscape 6 betas where selecting text that
included an applet would crash the browser if a mouse event handler
was attached to the applet. This was fixed by 6.0 final.