Producing web pages
* HTML CSS DHTML XHTML A to Z of tags        Accessibility          Design

<applet>

<applet
align=absbottom|absmiddle|baseline|bottom|left|
center|righttop|middle|textop

alt=text
archive=cdata
class=type
code=appletFile
codebase=codebaseURL
height=pixels
hspace=pixels
id=value
object=cdata
name=appletInstanceName
style=style
title=text
vspace=pixels
width=pixels>
<param name=AttributeName...>
</applet>

Runs a Java applet in an HTML page. This tag will disappear eventually and you should use <object> instead (mind the bugs).

Applet resources are loaded relative to the page URL. You can enter the codebase attribute to specifies a different location for the applet resources. The URL can be absolute or relative. Note that an absolute URL is not affected by the page's <base> tag but the relative URL is.

You must enter the end-tag.

An example:

<applet codebase="applets/javaapps"
	code="JavaDemo.class"
	width="100"
	height="200">
<param name="text" value="This is a Java applet.">
<img src="logo.gif" alt="Upgrade to Internet 
Explorer to view this Java applet.">
</applet>

Attributes

align=absbottom|absmiddle|baseline|bottom|left|
center|right|>top|middle|texttop

Describes the alignment of an object to text. The default is left.

Value…

Description…

absbottom

Aligns the bottom of the picture with the bottom of the current line

absmiddle

Aligns the middle of the current line with the middle of the picture

baseline

Aligns the bottom of the picture with the baseline of the current line

bottom

Aligns to the bottom of surrounding text

left

Aligns to the left of surrounding text

center

Aligns to the centre of surrounding text

right

Aligns to the right of surrounding text

top

Aligns to the top of surrounding text

middle

Aligns to the middle of surrounding text

texttop

Aligns itself with the top of the tallest text in the line

alt=text

Specifies text that the browser displays if it cannot run Java applets.

archive=cdata

Specifies a comma-separated list of archived files (either absolute URIs or URIs relative to the codebase), allowing the browser to download many files with a single connection and hence decreasing the total download time.

class=type

Indicates the class to which the tag belongs. You can use the class attribute in a style sheet to create different styles that you want apply to a single HTML tag. For example, you might create three different styles for a heading <hn> tag. See Using the class attribute as a selector for more details.

code=appletFile

The name of the Java applet. This file is relative to the base URL. It cannot be absolute.

codebase=codebaseURL

Specifies the base URL of the applet (the directory in which the applet is located).

height=pixels

Specifies the initial height in pixels of the applet display area.

hspace=pixels

Specifies the space which appears to the left and right of the applet.

id=value

Specifies a unique name for the tag. No two tags can have the same id on a single page. The value must begin with a letter followed by any alphanumeric character, a hyphen, an underscore, a colon or a full stop. You use it to reference a unique style for a tag or to manipulate the tag with a script.

object=cdata

Specifies a serialized (saved) representation of an applet. Don't use the code attribute if, and only if, you specify the object attribute. When the applet is deserialized, its init() method is not invoked, but its start() method is. Sun recommends restraint in using this poorly supported feature

name=appletInstanceName

Identifies an applet to other applets within the HTML page.

param name=AttributeName

Passes applet-specific arguments in from an HTML page. There may be no, one, or any number of param name attributes present in the <applet> start-tag.

For example, a decorative Java applet takes two parameters. The applet contains an animated GIF as an alternative for non-Java browsers.

<applet code="animate.class" width="100" height="100">
<param name="img1" value="/images/1.jpg">
<param name="img2" value="/images/2.jpg">
<img src="animation.gif" alt="" width="100" height="100">
</applet>

style=style

Specifies style information. See Style sheets for more information.

title=text

For information only. Some browsers display the title when you move the mouse over the tag (like a tool tip).

vspace=pixels

Specifies the space in pixels above and below the applet.

width=pixels

Specifies the initial width in pixels of the applet display area.