Java Reference
In-Depth Information
The
appletviewer
tool runs Java programs that require a web browser and are presented
as part of a Hypertext Markup Language (HTML) document. It takes an HTML docu-
ment as a command-line argument, as in the following example:
appletviewer NewAuctions.html
If the argument is a web address instead of a reference to a file,
appletviewer
will load
the HTML document at that address. For example:
B
appletviewer
http://www.javaonthebrain.com
Figure B.1 displays an applet loaded from this page, a site developed by cartoonist and
Java game programmer Karl Hörnell.
FIGURE B.1
Viewing Java web
applets outside of
a browser.
When an HTML document is loaded by
appletviewer
, every applet on that document
will begin running in its own window. The size of these windows depends on the
height
and
width
attributes that were set in the applet's
html
tag.
Unlike a web browser,
appletviewer
cannot be used to view the HTML document itself.
If you want to see how the applet is laid out in relation to the other contents of the docu-
ment, you must use a Java-capable web browser.
Mozilla Firefox and Microsoft Internet Explorer don't offer built-in
support for Java applets. Support for the language is available as
a browser plug-in from Sun Microsystems. The Java Plug-in from
Sun can be used to run a Java applet in a browser in place of the
browser's Java interpreter. The Plug-in is included in the Java
Runtime Environment, an interpreter for running Java programs
that is installed along with the Java Development Kit. If it isn't
already present on your system, you can download it from Sun's
website at
http://www.java.com.
CAUTION