O'Reilly logo

Dynamic HTML: The Definitive Reference by Danny Goodman

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Name

<APPLET> — NN 2 IE 3 HTML 3.2

Synopsis

<APPLET>...</APPLET>

End Tag: Required

You can embed an executable chunk of Java code in an HTML document in the form of an applet. An applet occupies a rectangular area of the page, even if it is only one-pixel square. An applet may require that some initial values be set from the HTML document. One or more PARAM elements can be used to pass parameters to the applet before the applet starts running (provided the applet is written to accept these parameters). PARAM elements go between the start and end tags of an APPLET element.

Applets are compiled by their authors into class files (filename suffix .class). An applet class file must be in the same directory as, or a subdirectory of, the HTML document that loads the applet. Key attributes of the APPLET element direct the browser to load a particular class file from the necessary subdirectory.

All user interface design for the applet is programmed into the applet in the Java language. One of the roles of attributes in the APPLET element is to define the size and other geographical properties of the applet for its rendering on the page. Recent browsers allow JavaScript scripts to communicate with the applet, as well as allowing applets to access document elements.

Note that HTML 4.0 deprecates the APPLET element in favor of the more generic OBJECT element. Browser support for the APPLET element will continue for some time to come, however.

Example

<APPLET CODE="simpleClock.class" NAME="myClock" ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required