Skip to Content

Applet Life Cycle Example

  • strict warning: Non-static method view::load() should not be called statically in /home/javaexa1/public_html/sites/all/modules/views-6.x-2.16/views/views.module on line 906.
  • strict warning: Declaration of views_handler_argument::init() should be compatible with views_handler::init(&$view, $options) in /home/javaexa1/public_html/sites/all/modules/views-6.x-2.16/views/handlers/views_handler_argument.inc on line 0.
  • strict warning: Declaration of views_handler_filter::options_validate() should be compatible with views_handler::options_validate($form, &$form_state) in /home/javaexa1/public_html/sites/all/modules/views-6.x-2.16/views/handlers/views_handler_filter.inc on line 0.
  • strict warning: Declaration of views_handler_filter::options_submit() should be compatible with views_handler::options_submit($form, &$form_state) in /home/javaexa1/public_html/sites/all/modules/views-6.x-2.16/views/handlers/views_handler_filter.inc on line 0.
  • strict warning: Declaration of views_handler_filter_boolean_operator::value_validate() should be compatible with views_handler_filter::value_validate($form, &$form_state) in /home/javaexa1/public_html/sites/all/modules/views-6.x-2.16/views/handlers/views_handler_filter_boolean_operator.inc on line 0.
  • strict warning: Declaration of views_plugin_style_default::options() should be compatible with views_object::options() in /home/javaexa1/public_html/sites/all/modules/views-6.x-2.16/views/plugins/views_plugin_style_default.inc on line 0.
  • strict warning: Declaration of views_plugin_row::options_validate() should be compatible with views_plugin::options_validate(&$form, &$form_state) in /home/javaexa1/public_html/sites/all/modules/views-6.x-2.16/views/plugins/views_plugin_row.inc on line 0.
  • strict warning: Declaration of views_plugin_row::options_submit() should be compatible with views_plugin::options_submit(&$form, &$form_state) in /home/javaexa1/public_html/sites/all/modules/views-6.x-2.16/views/plugins/views_plugin_row.inc on line 0.

  1. /*
  2.         Applet Life Cycle Example
  3.         This java example explains the life cycle of Java applet.
  4. */
  5.  
  6. import java.applet.Applet;
  7. import java.awt.Graphics;
  8.  
  9. /*
  10.  *
  11.  * Applet can either run by browser or appletviewer application.
  12.  * Define <applet> tag within comments as given below to speed up
  13.  * the testing.
  14.  */
  15.  
  16. /*
  17. <applet code="AppletLifeCycleExample" width=100 height=100>
  18. </applet>
  19. */
  20.  
  21.  
  22. public class AppletLifeCycleExample extends Applet{
  23.  
  24.        
  25.         /*
  26.          * init method is called first.
  27.          * It is used to initialize variables and called only once.
  28.          */
  29.         public void init() {
  30.                 super.init();
  31.         }
  32.        
  33.         /*
  34.          * start method is the second method to be called. start method is
  35.          * called every time the applet has been stopped.
  36.          */
  37.         public void start() {
  38.                 super.start();
  39.         }
  40.        
  41.         /*
  42.          * stop method is called when the the user navigates away from
  43.          * html page containing the applet.
  44.          */
  45.         public void stop() {
  46.                 super.stop();
  47.         }
  48.        
  49.         /* paint method is called every time applet has to redraw its
  50.          * output.
  51.          */
  52.         public void paint(Graphics g) {
  53.                 super.paint(g);
  54.         }
  55.        
  56.         /*
  57.          * destroy method is called when browser completely removes
  58.          * the applet from memeory. It should free any resources initialized
  59.          * during the init method.
  60.          */
  61.         public void destroy() {
  62.                 super.destroy();
  63.         }
  64.  
  65. }