Preparing an Applet
The applet should be run through the javac compiler getting a .class file as before: javac MyApplet.java
The resulting file, MyApplet.class, is stored in the document collection of a web server, at some URL.
Create a separate HTML file with an applet tag:
<APPLET
CODEBASE=http://myserver.org/mydirectory
CODE=“MyApplet.class”
WIDTH=300 HEIGHT=100>
When the browser loads the HTML file, it also downloads the .class file and the java interpreter calls the init(), start(), and paint() methods.