# applet

Defines a Java applet object.

## Platform Support

IE | Netscape | Mozilla | Opera | Safari
--- | --- | --- | --- | ---
2.0+ | 2.0+ | 1.0+ | 7.0+ | 1.0+

## Example

This example defines center-aligned applet named "myApplet":

    <applet code="/java/myApplet.class" align="center" height="350" width="350">
    	<p> Install Java before trying to view this applet.</p>
    </applet>

## Remarks

The <applet></applet> tag is deprecated with W3C-compliant HTML 4.01. Use <object></object> instead.

## Attribute Detail

Attribute | IE | Netscape | Mozilla | Opera | Safari
--- | --- | --- | --- | --- | ---
accesskey [key]. Hot-key shortcut for the element. | 5.5+ | no | no | no | 1.0+
align Defines the alignment of the element. | 2.0+ | 1.0+ | 1.0+ | 4.0+ | 1.0+
alt [text]. Example values (Usually a name/description of the element): "banner.gif", "cat.jpg", etc. Specifies alternative text to display if the element cannot be displayed as expected. | 2.0+ | 1.0+ | 1.0+ | 4.0+ | 1.0+
archive [url, url, ...] URL or list of URLs that need to be preloaded for the element. | 3.0+ | 4.0+ | 1.0+ | 4.0+ | 1.0+
class [class-name]. Example values: header-class, list-element, etc. CSS class assigned to the element. | 2.0+ | 1.0+ | 1.0+ | 4.0+ | 1.0+
code [url] URL of the Java class file for the element. | 2.0+ | 2.0+ | 1.0+ | no | 1.0+
codebase [url] URL for the code base for the element. | 2.0+ | 2.0+ | 1.0+ | no | 1.0+
datafld [field-name] For a databound element, specifies the field supplying the data. | 4.0+ | no | no | no | no
datasrc [name/id-of-data-source] For a databound element, specifies the id of the data source. | 4.0+ | no | no | no | no
height [number-of-pixels] Height of the element (in pixels). | 2.0+ | 1.0+ | 1.0+ | 4.0+ | 1.0+
hidefocus Specifies whether the element shows a visual cue when it has focus. | 5.5+ | no | no | no | no
hspace [number-of-pixels] Number of pixels of space to the left and right of the element (i.e. horizontal margin). | 2.0+ | 1.0+ | 1.0+ | 4.0+ | 1.0+
id [element-id] Unique identifier for the element. | 2.0+ | 1.0+ | 1.0+ | 4.0+ | 1.0+
mayscript (applet) [scripting-language-allowed] If true, indicates that scripts in the document may access the applet. | no |  | no | no | 1.0+
name [element-name] Unique name identifier for the element. | 2.0+ | 1.0+ | 1.0+ | 4.0+ | 1.0+
object (applet) [URL] Name of the resource containing a serialized version of the applet. | 4.0+ |  | 1.0+ | 7.0+ | 1.0+
src [url] URL for the source for the element. | 2.0+ | 1.0+ | 1.0+ | 4.0+ | 1.0+
style [style-name] Inline style for the element. | 2.0+ | 1.0+ | 1.0+ | 4.0+ | 1.0+
tabindex [number] Position of the element in the tabbing order for the document. | 2.0+ | 1.0+ | 1.0+ | 4.0+ | 1.0+
title [text-description] Short text description for the element. | 2.0+ | 1.0+ | 1.0+ | 4.0+ | 1.0+
vspace [number-of-pixels] Number of pixels of space above and below the element (i.e. vertical margin). | 2.0+ | 1.0+ | 1.0+ | 7.0+ | 1.0+
width [number-of-pixels | percentage]. Example values: 200px, 15%, etc. Width of the element (pixels or percentage). | 2.0+ | 1.1+ | 1.0+ | 4.0+ | 1.0+
unselectable Specifies whether or not the element is unselectable. | 5.5+ | no | no | no | no

## Event Detail

Event | IE | Netscape | Mozilla | Opera | Safari
--- | --- | --- | --- | --- | ---
onactivate Fires when the element becomes active. | 4.0+ | no | no | no | no
onbeforeactivate Fires immediately before the element becomes active. | 4.0+ | no | no | no | no
onbeforecut Fires immediately before the selection is cut to the clipboard. | 4.0+ | no | no | no | 1.0+
onbeforedeactivate Fires immediately before the element stops being the active element. | 4.0+ | no | no | no | no
onbeforeeditfocus Fires immediately before the element receives focus prior to being edited. | 4.0+ | no | no | no | no
onbeforepaste Fires immediately before the selection is pasted from the clipboard to the element. | 4.0+ | no | no | no | 1.0+
onblur Fires when the element loses focus. | 2.0+ | 1.0+ | 1.0+ | 4.0+ | 1.0+
oncontextmenu Fires when the element is right-clicked and the context menu opens. | 4.0+ | no | no | no | 1.0+
oncontrolselect Fires immediately before the element is selected. | 4.0+ | no | no | no | no
oncut Fires when the element is cut to the clipboard. | 4.0+ | no | no | no | 1.0+
ondataavailable Fires when data becomes available from an asyncrhonous data source. | 4.0+ | no | no | no | no
ondatasetchanged Fires when data in a dataset changes. | 4.0+ | no | no | no | no
ondatasetcomplete Fires when a dataset finishes loading. | 4.0+ | no | no | no | no
ondblclick Fires when the element is double-clicked. | 2.0+ | 1.0+ | 1.0+ | 4.0+ | 1.0+
ondeactivate Fires when the active element becomes inactive. | 4.0+ | no | no | no | no
onfocus Fires when the element receives focus. | 2.0+ | 1.0+ | 1.0+ | 4.0+ | 1.0+
onfocusin Fires immediately before an element receives focus. | 4.0+ | no | no | no | no
onfocusout Fires immediately after focus moves from the element to another element. | 4.0+ | no | no | no | no
onhelp Fires when a user presses the F1 key to activate help. | 4.0+ | no | no | no | no
onkeypress Fires when a user presses a key or holds down the key while the element has focus. | 2.0+ | 1.0+ | 1.0+ | 4.0+ | 1.0+
onload Fires when the content of the element finishes loading. | 2.0+ | 1.0+ | 1.0+ | 4.0+ | 1.0+
onlosecapture Fires when the element loses mouse capture. | 4.0+ | no | no | no | no
onmousedown Fires when a user clicks down on the mouse button while the element has focus. | 2.0+ | 1.0+ | 1.0+ | 4.0+ | 1.0+
onmouseenter Fires when the mouse pointer enters the element. | 4.0+ | no | no | no | no
onmouseleave Fires when the mouse pointer leaves the element. | 4.0+ | no | no | no | no
onmousewheel Fires when the user rotates the mouse wheel while the element has focus. | 4.0+ | no | no | no | no
onmove Fires when the element moves. | 4.0+ | no | no | no | no
onmoveend Fires when the element stops moving. | 4.0+ | no | no | no | no
onmovestart Fires immediately before the element moves. | 4.0+ | no | no | no | no
onpaste Fires when the clipboard contents are pasted onto the element. | 4.0+ | no | no | no | 1.0+
onpropertychange Fires when one of the properties of the element changes. | 4.0+ | no | no | no | no
onreadystatechange Fires when the ready state of the element changes. | 4.0+ | no | no | no | no
onresize Fires immediately before an element is about to be resized. | 4.0+ | no | no | no | 1.0+
onresizeend Fires when the element is finished being resized. | 4.0+ | no | no | no | no
onresizestart Fires immediately before a user resizes the element. | 4.0+ | no | no | no | no
onrowenter Fires if the data values for the row change in the datasource. | 4.0+ | no | no | no | no
onrowexit Fires immediately before the data values for the row change in the datasource. | 4.0+ | no | no | no | no
onrowsdelete Fires immediately before rows are deleted from the dataset. | 4.0+ | no | no | no | no
onrowsinserted Fires immediately after rows are inserted into the dataset. | 4.0+ | no | no | no | no
onscroll Fires when a user scrolls the element. | 4.0+ | no | no | no | 1.0+

text_html aptana_docs