The Applet Life Cycle
Home ] Up ] Introduction to Applets ] A Simple Applet ] HTML Tags for Applets ] [ The Applet Life Cycle ] Multimedia and URLs ] Applet Context ] Converting Applications to Applets ]

 

Demonstration

 

Here is a state transition diagram showing the possible states of an applet, during its lifetime:

The four applet methods that cause state transitions are:

Method Description
init() Called when the applet is first loaded into the browser. Performs applet initialization. Called once only.
start() Called after the init() method has completed. Also called when the browser opens the page again after having read other pages. Can be called many times.
stop() Called when the browser moves off the page. Can be called many times.
destroy() Called with the applet is about to be unloaded from the browser. Performs resource cleanup. Called once.
 

This page was last modified on 02 October, 2007