To test your applets using the applet viewer, put the following comment in your Java file:
/* */
Then you won’t need an HTML file for your applet code. The applet viewer will parse the applet tag and display the applet. Now, you can test it your applet by typing this at the prompt:
appletviewer AnApplet.java