Applet Life Cycle in Java

Reviews of webeduclick.com
Every Java applet inherits a set of default behaviours from the Applet class. As a result, when an applet is loaded, it undergoes a series of changes in its states.
The applets states are included in Fig:
applet life-cycle

  • Born or Intialization State
  • Running State
  • Idle State
  • Dead State
  • 1. Born or Intialization State: Applets enters the initialization state when it is first loaded. It is achieved by init() method of Applet class. Then applet is born.

    public void init()
    {
     .............
     .............
      (Action)
    }
    

    2. Running State: Applet enters the running state when the system calls the start() method of Applet class. This occurs automatically after the applet is initialized.

    public void start()
    {
     .............
     .............
      (Action)
    }
    

    3. Idle State: An applet becomes idle when it is stopped from running. Stopping occurs automatically when we leave the page containing the currently running applet. This is achieved by calling the stop() method explicitly.

    public void stop()
    {
     .............
     .............
      (Action)
    }
    

    4. Dead State: An applet is said to be dead when it is removed from memory. This occurs automatically by invoking the destroy() method when we want to quit the browser.

    public void destroy()
    {
     .............
     .............
      (Action)
    }