When you create an applet, you have to extend Applet class. Applet can override init, start, stop and destroy methods to respond to corresponding events.

Java Code:
public class Simple extends java.applet.Applet {
    . . .
    public void init() { . . . }
    public void start() { . . . }
    public void stop() { . . . }
    public void destroy() { . . . }
    . . .
}
Not every applet needs to override all four of these methods.