|
||
|
Lesson 5
Objective
|
The Java AppletViewer Use AppletViewer to run Java applets |
|
|
Use the AppletViewer to run Java applets without a Web browser.
Running an applet in the AppletViewer
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 doesn't 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 doesn't 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 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:
Applet Viewer - Exercise
Click the Exercise link to run a Java applet using the AppletViewer. Applet Viewer - Exercise |
||
|
|
||
