User menu

You are here

Home
Applet (<applet>)

[Name]
NAME
[Syntax]
SYNTAX
[Description]
DESCRIPTION
[Name]
ATTRIBUTE(S)
[Notes]
NOTES
[Example(s)]
EXAMPLE(S)
[Cross Reference(s)]
CROSS REFERENCE(S)


[Name]
NAME
Applet element (Java Applets)
[Syntax]
SYNTAX
<APPLET>any string of text</APPLET>
[Description]
DESCRIPTION
This element allows a Java applet to be embedded into an HTML document. It is supported by all Java enabled browsers. The applet accepts parameters via associated PARAM elements. The content of the applet should be used to provide an alternative to the applet for browsers that do not support Java. Java compatible browsers simply ignore the text.
[Attribute(s)]
ATTRIBUTE(S)
NAME DOMAIN DESCRIPTION
CODEBASE a valid URL This optional attribute specifies the base URL of the applet. That is the directory that contains the applet's code. If this attribute is not specified, then the containing document's URL is used.
CODE a file name This attribute is REQUIRED and gives the name of the file that contains the applet's compiled applet class. This file is relative to the base URL of the applet and cannot be absolute.
ALT any string of text This attribute specifies any text that should be displayed if the browser understands the APPLET tag but cannot run Java applets.
NAME a name for the applet Specifies a name for the applet instance which makes it possible for applets on the same page to communicate with each other.
WIDTH a number of pixels This REQUIRED attribute gives the initial width of the applet display area.
HEIGHT a number of pixels This REQUIRED attribute gives the initial height of the applet display area.
ALIGN top, middle, bottom, left, right This specifies how the applet is positioned relative to the current line of text in which the applet is placed.

The top value positions the applet with the top of the current text line. Browsers vary in how they interpret this. Some only take into account what has occurred on the text line prior to the APPLET element and ignore what happens after it.

The middle value aligns the middle of the baseline for the current line of text.

The bottom value is the default and aligns the bottom of the applet with the baseline.

The left value floats the applet to the current left margin, temporarily changing this margin, so that subsequent text is flowed along the applet's right hand side. The rendering depends on whether there is any left aligned text or applets that appear earlier than the current applet in the markup. Such text (but not applets) generally forces left aligned applets to wrap to a new line, with the subsequent text continuing on the former line.

The right value floats the applet to float current right margin, temporarily changing this margin, so that subsequent text is flowed along the image's left hand side. The rendering depends on whether there is any right aligned text or applets that appear earlier than the current image in the markup. Such text (but not applets) generally forces right aligned applets to wrap to a new line, with the subsequent text continuing on the former line.
HSPACE number of pixels This can be used to provide white space to the immediate left and right of the applet. The HSPACE attribute sets the width of this white space in pixels. By default the HSPACE value is a small non-zero number.
VSPACE number of pixels This can be used to provide white space above and below the applet. The VSPACE attribute sets the height of this white space in pixels. By default the VSPACE value is a small non-zero number.
[Notes]
NOTES
  • The code, width, and height attributes are ALL required
  • Start AND End tags are required
[Example(s)]
EXAMPLE(S)
  • <APPLET CODE="animation.class" WIDTH=300 HEIGHT=300>
    Java applet to show animated picture
    </APPLET>
  • <APPLET CODE="audioPlayer.class" WIDTH=300 HEIGHT=300>Java applet to show animated picture</APPLET>
    <PARAM name=aSound value="Hello.au">
    Java applet to play an audio file named Hello.au passed in through a parameter
    </APPLET>
[Cross Reference(s)]
CROSS REFERENCE(S)

Recent content

New forum topics

Recent comments

No comments available.

Google Search

Google Ads

Visitors

  • Total Visitors: 331753
  • Unique Visitors: 48602
  • Registered Users: 75210
  • Last Registered User: Michailxaw
  • Published Nodes: 192
  • Your IP: 54.197.64.207
  • Since: 04/17/2023 - 16:53

Who's online

There are currently 0 users online.