A Java Applet is a Java program that executes inside a browser. Essentially, a small portion of the browser window functions as a virtual computer, and the Java program executes on this computer. If there are several Applets executing in a browser window, they can execute independently.
Creating an Applet involves creating a Java class that extends the Java Applet class. When the Applet runs, the methods defined in this class are executed. Here is an example of a Java Applet.
To run this applet, you need to create an html file which includes the line
< applet code="Rings.class" width=275 height=350 >
To run the applet, you open the html file with your browser. To run this applet, click here. This opens the file Rings.html which contains the reference to the applet contained in Rings.class.
If the html file had several references to several applets in it, the browser would run all the applets simultaneously. Like this.