Slide 3.10: Line-by-line anatomy of HelloMIDlet.java (cont.)
  Slide 3.12: Line-by-line anatomy of HelloMIDlet.java (cont.)
  Home


Line-by-line Anatomy of HelloMIDlet.java (Cont.)


A MIDlet goes through the following states:
  1. When the MIDlet is about to be run, an instance is created. The MIDlet's constructor is run, and the MIDlet is in the Paused state.

  2. Next, the MIDlet enters the Active state after the application manager calls startApp( ).

  3. While the MIDlet is Active, the JAM can suspend its execution by calling pauseApp( ), which puts the MIDlet back in the Paused state.

  4. The application manager can terminate the execution of the MIDlet by calling destroyApp( ), at which point the MIDlet is Destroyed and patiently awaits garbage collection.

display = Display.getDisplay(this);
The method public static Display javax.microedition.lcdui.Display.getDisplay (MIDlet m) gets the Display object that is unique to this MIDlet.

cmdExit = new Command("Exit", Command.SCREEN, 1);
The constructor public javax.microedition.lcdui.Command(String label, int commandType, int priority) creates a new command object with the following parameters: