Java Technology  «Prev  Next»
Lesson 5 The Java AppletViewer
ObjectiveUse AppletViewer to run Java applets

Java AppletViewer

Use the AppletViewer to run Java applets without a Web browser.
The Java AppletViewer is a tool used to run applets. It works, essentially, like a pared-down Web browser. The AppletViewer bypasses the additional overhead of a Web browser and is also guaranteed to support the version of the SDK you are using.
The AppletViewer is incredibly useful because it provides a simple, efficient way to test Java applets. However, this does not mean you shouldn't also test applets in a real Web browser. You should always test applets with a real Web browser since that's what users will ultimately be using to run them.
The AppletViewer does not operate directly on applets. Instead, you provide it with a Web page that contains an embedded Java applet. The AppletViewer then ignores everything but the <APPLET> HTML tag and displays a window containing the executing applet.

Running an applet in the AppletViewer

Running an applet in the AppletViewer involves executing a command at the command-line and providing the appropriate Web page name.
Following is an example of running the TicTacToe applet with the AppletViewer:

Java Applet Viewer
  1. The actual name of the AppletViewer program
  2. The name of the Web page containing the TicTacToe applet. Provided as the only argument to the AppletViewer.

Applet Viewer

Applet Viewer - Exercise

Click the Exercise link to run a Java applet using the AppletViewer.
Applet Viewer - Exercise