The Anatomy of an Applet


Methods for Drawing and Event Handling

public class Simple extends java.applet.Applet {
    . . .
    public void paint(Graphics g) { . . . }
    . . .
}
The Simple applet implements the paint() method, which is one of the drawing and event-handling methods that every Applet inherits from the AWT Component class.

Drawing

The paint() method is one of two display methods that the Component class provides:
paint()
the basic display method. Applets that use graphics primitives (as opposed to displaying only pre-made graphics or Components) implement this method to draw the applet's representation within a browser page.