Java Reference
In-Depth Information
where the necessary applet bytecode is located. The next section, Docu-
ment and Code Base , discusses the code base in detail.
archive. The name of a JAR file (or files) that contains any additional files
required by the applet. Use a comma to separate multiple filenames. All
.class files in the archives are loaded by the JVM's class loader, making
the classes available to the applet. Note that the applet class itself can be
located in one of the archives as well. Examples of files in an archive
include .class files, images (such as .gif or .jpg files), audio files, and data
files. The upcoming section JAR File and Applets discusses how to create
and use an archive.
name. The name of this instance of the applet. You can create multiple
applets on a Web page, and they can locate each other by using this
name attribute and the AppletContext class. You will do this in Lab 14.4.
align. A standard HTML attribute that specifies the alignment of the
applet relative to other items around it on the Web page. The possible
values are left, right, top, bottom, middle, texttop, absmiddle, absbot-
tom, and baseline.
vspace. A standard HTML attribute that specifies the number of pixels to
appear above and below the applet.
hspace. A standard HTML attribute that specifies the number of pixels to
appear to the left and right of the applet.
alt. A standard HTML attribute that allows you to specify text that appears
if the browser understands the <applet> tag but cannot run the applet.
If a Web browser does not understand the <applet> tag, it will ignore the
tag and display any HTML that appears within the opening and closing
<applet> tags. For example, the following HTML displays a message that
the user is unable to see the applet that was intended to appear:
<applet code=”com.wiley.MyApplet”
width=”200”
height=”348”
alt=”MyApplet failed”>
<h2>Your browser does not support applets!</h2>
<p>To view this page correctly, you will need to find a Web
browser that provides support for applets, or install the
Java Plug-in.</p>
</applet>
Visitors to this page who have a Web browser that supports applets will
not see the message about their browser not supporting applets. Note
that if their browser supports applets but, for some reason, cannot run
applets, the visitor will see the alt message “MyApplet failed.”
Search WWH ::




Custom Search