Java Applet Life Cycle
The life cycle of a Java Applet has five main steps.
In this step, the Applet is initialized. public void init() is the method used to initialize an Applet. It is only invoked once.
In this step the Applet is start with the help of public void start() method. The start() method is invoked after calling the init() method.
public void paint(Graphics g) method is used to paint the Applet. The method provides graphics class objects that can be used to draw shapes such as oval, rectangle, arc etc.
The applet is stopped with the help of public void stop() method. The method is invoked when the Applet is stopped of the browser is minimized.
This is the final step in the Applet life cycle. The Applet initialized is destroyed in this step. It is only invoked once and the method used to invoke is, public void destroy().
The life cycle of a Java Applet has five main steps.
- Initialize the Applet
- Start the Applet
- Paint Applet
- Stop the Applet
- Destroy the Applet
Life Cycle of a Java Applet |
No comments :
Post a Comment