Remember that to write an applet, you must prepare a file called something like myprogram.java and compile it as usual:
javac myprogram.javaproducing a file myprogram.class. Then you must prepare a file myprogram.html which has an applet tag to myprogram.class.
To view your applet, place all your files in your web directory. To run appletviewer, execute the following line:
appletviewer myprogram.htmlAppletviewer will bring up a window with just the applet part of the html page. This is especially useful while you're debugging.
You can also view your applet via a web browser. In the browser, either
enter the URL of your web directory and your HTML file name at the
end, or just open the HTML file using File | Open feature in the menus
of your browser