antagonist
12-12-2008, 11:23 AM
The following code gives a simplified look at the four main parts of the <APPLET> tag:
<APPLET Attributes>
applet paremeters
alternate HTML
</APPLET>
Placing the required attributes
Attributes are keywords that tell the browser to do something special when they encounter a tag; in the case of the <APPLET> opening tag, this something is a bit more complex than with most other tags. Although many tags consist of nothing more than a letter or two (<B>, <I>, <BR>, and so forth) and no attributes whatsoever, the <APPLET> tag requires that you provide the initial part of the opening tag (<APPLET>) and at least three attributes that together tell the browser the name of the applet and ho much space the applet will take up when displayed:
<APPLET CODE="Example" HEIGHT=25 WIDTH=450>
This example specefies an applet named Example. The opening tag's CODE attribute identefies the file contains the applet. The HEIGHT and WIDTH attributes of the opening tag tell the browser how much space the applet requires in the Web page. In this case, the applet takes up 25 pixels in height and 450 pixels in width.
------------------------------------------------------------------------
Required Applet Attributes
Attribute Description
CODE- Specifies the name of the applet file.
HEIGHT- Specifies the height of your applet in pixels.
WIDTH- Specifies the width of you applet in pixels.
------------------------------------------------------------------------
Optional Applet Attributes
Attribute Description
ALIGN - This attribute specifies where your applet is placed
on the page in respect to the text around it; it
may have one of the following nine alignments: left,
right, top, texttop, middle, absmiddle,
baseline,bottom, and absbottom.
ALT - This attribute gives Java-Savvy browsers alternative
text to display if they are incapable of executing the
applet for some reason. This text is seen only by
Java-Savvy browsers because it falls within the
openeing <APPLET> tag. (Non-Java browsers skip
over this tag because they do not know how to deal
with applets.) If you want to communicate with non-
Java browsers, do so by using alternate HTML- Plain
old fashioned HTML that appears immediatley before
the closing </APPLET> tag.
CODEBASE - This attribute specifies the URL for your applet, or in
other words, it describes where the applet file is
located. The applet must be located relative to this
URL. If you don't specify CODEBASE, the applet is
expected to reside in the same directory as the Web
page.
HSPACE - This attribute specifies the horizontal space
surrounding your applet.
VSPACE - This attribute specifies the vertical space
surrounding your applet.
NAME - This attribute specifies the symbolic name of your
applet, allowing other applets embedded in the same
page to locate your applet by name. You can only
use this attribute when applets on a page
communicate with one another, something most
applets don't do.
Enjoy this tutorial.. this took a long time to think and type out.
<APPLET Attributes>
applet paremeters
alternate HTML
</APPLET>
Placing the required attributes
Attributes are keywords that tell the browser to do something special when they encounter a tag; in the case of the <APPLET> opening tag, this something is a bit more complex than with most other tags. Although many tags consist of nothing more than a letter or two (<B>, <I>, <BR>, and so forth) and no attributes whatsoever, the <APPLET> tag requires that you provide the initial part of the opening tag (<APPLET>) and at least three attributes that together tell the browser the name of the applet and ho much space the applet will take up when displayed:
<APPLET CODE="Example" HEIGHT=25 WIDTH=450>
This example specefies an applet named Example. The opening tag's CODE attribute identefies the file contains the applet. The HEIGHT and WIDTH attributes of the opening tag tell the browser how much space the applet requires in the Web page. In this case, the applet takes up 25 pixels in height and 450 pixels in width.
------------------------------------------------------------------------
Required Applet Attributes
Attribute Description
CODE- Specifies the name of the applet file.
HEIGHT- Specifies the height of your applet in pixels.
WIDTH- Specifies the width of you applet in pixels.
------------------------------------------------------------------------
Optional Applet Attributes
Attribute Description
ALIGN - This attribute specifies where your applet is placed
on the page in respect to the text around it; it
may have one of the following nine alignments: left,
right, top, texttop, middle, absmiddle,
baseline,bottom, and absbottom.
ALT - This attribute gives Java-Savvy browsers alternative
text to display if they are incapable of executing the
applet for some reason. This text is seen only by
Java-Savvy browsers because it falls within the
openeing <APPLET> tag. (Non-Java browsers skip
over this tag because they do not know how to deal
with applets.) If you want to communicate with non-
Java browsers, do so by using alternate HTML- Plain
old fashioned HTML that appears immediatley before
the closing </APPLET> tag.
CODEBASE - This attribute specifies the URL for your applet, or in
other words, it describes where the applet file is
located. The applet must be located relative to this
URL. If you don't specify CODEBASE, the applet is
expected to reside in the same directory as the Web
page.
HSPACE - This attribute specifies the horizontal space
surrounding your applet.
VSPACE - This attribute specifies the vertical space
surrounding your applet.
NAME - This attribute specifies the symbolic name of your
applet, allowing other applets embedded in the same
page to locate your applet by name. You can only
use this attribute when applets on a page
communicate with one another, something most
applets don't do.
Enjoy this tutorial.. this took a long time to think and type out.