Draw applet life cycle diagram.
Applet Life Cycle Diagram in Java
The Java applet life cycle follows a fixed sequence of methods managed by the browser or applet viewer. Below is a clean diagram showing the flow and state transitions.
Page Loaded / Applet Created
|
init()
|
start()
|
+------------+------------+
| |
paint()/update()/repaint() |
| |
+------------+------------+
|
Page Hidden / Tab Unfocused
|
stop()
|
Page Closed / Applet Removed
|
destroy()
What Each Method Does
- init(): Runs once; allocate resources and initialize UI/components.
- start(): Called each time the applet becomes visible or active.
- paint()/update()/repaint(): Handles drawing and screen refresh.
- stop(): Pauses work when the applet is hidden or the page is switched.
- destroy(): Final cleanup before the applet is unloaded.
