www.pudn.com > TWPlaneGame.rar > PlaneGameMIDlet.java


package twplanegame; 
 
import javax.microedition.midlet.*; 
import javax.microedition.lcdui.*; 
/* 
public class PlaneGameMIDlet extends MIDlet { 
  private static PlaneGameMIDlet instance; 
  private PlaneGameCanvas displayable = new PlaneGameCanvas(); 
 
  /** Constructor */ 
//  public PlaneGameMIDlet() { 
//    instance = this; 
//  } 
 
  /** Main method */ 
//  public void startApp() { 
//    Display.getDisplay(this).setCurrent(displayable); 
//  } 
 
  /** Handle pausing the MIDlet */ 
//  public void pauseApp() { 
//  } 
 
  /** Handle destroying the MIDlet */ 
//  public void destroyApp(boolean unconditional) { 
//  } 
 
  /** Quit the MIDlet */ 
//  public static void quitApp() { 
//    instance.destroyApp(true); 
//    instance.notifyDestroyed(); 
//    instance = null; 
//  } 
 
//} 
 
public class PlaneGameMIDlet extends MIDlet implements AppExiter 
{ 
 
   PlaneGameCanvas gameCanvas = new PlaneGameCanvas(this); 
 
   Display display; 
 
   protected void startApp(){ 
      // create the screen and pass a reference to so that EXIT can be performed 
      // tell the Display Manager to display our screen 
      display = Display.getDisplay(this); 
      display.setCurrent(gameCanvas); 
   } 
 
   protected void pauseApp(){} 
 
   protected void destroyApp(boolean unconditional) 
   { 
      notifyDestroyed(); 
   } 
   public void exitApp() 
   { 
      destroyApp(true); 
   } 
}