Creating Applets
An applet is a Java program that is embedded into an HTML document, transported across a network (like the web) and executed using a web browser. This is different from an application, which is a stand alone program executed using the Java interpreter.
To create an applet in Java, you must first import the Applet package and the graphics capabilities of the java.awt package. This is done at the top of the program:
To create an applet in Java, you must first import the Applet package and the graphics capabilities of the java.awt package. This is done at the top of the program:
A class defining an applet 'extends' the Applet class, which means it inherits the functionality of the Applet class. This is done by adding "extends Applet" after the class name:
Applet classes do not have a main method since they are run by the browser.