📄 gamemidlet.java
字号:
package game;
import javax.microedition.midlet.*;
import javax.microedition.lcdui.*;
public class GameMIDlet extends MIDlet implements CommandListener{
Display display;
public GameMIDlet() {
super();
display=Display.getDisplay(this);
}
SpriteGame mgc;
protected void startApp() throws MIDletStateChangeException {
if(mgc==null){
System.out.println("aaaaaaaaaaa1");
mgc=new SpriteGame();
System.out.println("aaaaaaaaaaa2");
mgc.addCommand(new Command("start",Command.OK,1));
mgc.addCommand(new Command("end",Command.OK,2));
mgc.setCommandListener(this);
display.setCurrent(mgc);
System.out.println("aaaaaaaaaaa3");
}
}
protected void pauseApp() {
}
protected void destroyApp(boolean arg0) throws MIDletStateChangeException {
}
public void commandAction(Command c, Displayable d) {
String cmd=c.getLabel();
if(cmd.equals("start")){
mgc.start();
}else if(cmd.equals("end")){
mgc.exit();
notifyDestroyed();
}
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -