«^»
4.5. Using appletviewer when developing Java applets

When developing a Java applet, the .class file will often be changed before the final version is produced. One problem that authors of Java applets often face is the difficulty in persuading a WWW browser to load a new version of a .class file if the .class file has changed on the author's WWW site. With some releases of some WWW browsers, pressing the Shift key at the same time as clicking the browser's Reload button may cause it to reload everything. If this does not work, then the only sure way to get round this problem is to exit from the WWW browser and to start it up again.

If you are developing a WWW applet, it will be very tedious if you have to restart the WWW browser frequently.

However, the SDK/JDK comes with a tool called appletviewer that can be used to view the output of an applet whose .class file is mentioned in a WWW page. So, having compiled some Java source code, e.g.:

javac HelloJApplet.java
the HelloJApplet.class file can be executed and its output can be displayed by running the following Unix/MS-DOS command:
appletviewer HelloJApplet.html
You can keep this appletviewer program running. If you subsequently make a change to the HelloJApplet.java file and then recompile it, you can get appletviewer to load the new version of the HelloJApplet.class file by clicking on the Reload option of the appletviewer's menu. So this appletviewer program provides a useful tool for testing Java applets.