www.pudn.com > Russian.rar > Russian.java


import javax.microedition.lcdui.*; 
import javax.microedition.midlet.*; 
/* 
 * Created on 2004-10-21 
 * 
 * TODO To change the template for this generated file go to 
 * Window - Preferences - Java - Code Style - Code Templates 
 */ 
 
/** 
 * @author Administrator 
 * 
 * TODO To change the template for this generated type comment go to 
 * Window - Preferences - Java - Code Style - Code Templates 
 */ 
public class Russian extends MIDlet implements CommandListener 
{ 
    private Display ds; 
    private Command exit; 
    private Command start; 
    private Command stop; 
    private Command pause; 
    private GameFrm gf;	 
         
    /** 
     *  
     */ 
    public Russian() { 
        super(); 
        // TODO Auto-generated constructor stub 
        ds = Display.getDisplay(this); 
        exit  = new Command("Exit",  Command.SCREEN, 1); 
        start = new Command("Start", Command.SCREEN, 0); 
        stop  = new Command("Stop",  Command.SCREEN, 2); 
        pause = new Command("Pause", Command.SCREEN, 2); 
        gf = new GameFrm(); 
    } 
 
    /* (non-Javadoc) 
     * @see javax.microedition.midlet.MIDlet#startApp() 
     */ 
    protected void startApp() throws MIDletStateChangeException { 
        // TODO Auto-generated method stub 
        gf.addCommand(exit); 
        gf.addCommand(start); 
        gf.addCommand(stop); 
        gf.addCommand(pause); 
        gf.setCommandListener(this); 
        ds.setCurrent(gf); 
    } 
 
    /* (non-Javadoc) 
     * @see javax.microedition.midlet.MIDlet#pauseApp() 
     */ 
    protected void pauseApp() { 
        // TODO Auto-generated method stub 
 
    } 
 
    /* (non-Javadoc) 
     * @see javax.microedition.midlet.MIDlet#destroyApp(boolean) 
     */ 
    protected void destroyApp(boolean arg0) throws MIDletStateChangeException { 
        // TODO Auto-generated method stub 
 
    } 
 
    public void commandAction(Command c, Displayable d) 
    { 
        if (exit == c) 
            this.notifyDestroyed(); 
        else if (start == c) 
            gf.start(); 
        else if (stop == c) 
            gf.stop(); 
    } 
}