📄 gamemidlet.java
字号:
import javax.microedition.lcdui.Command;
import javax.microedition.lcdui.CommandListener;
import javax.microedition.lcdui.Display;
import javax.microedition.lcdui.Displayable;
import javax.microedition.midlet.MIDlet;
public class GameMIDlet extends MIDlet implements CommandListener {
Display display;
public GameMIDlet() {
display = Display.getDisplay(this);
}
Start mgc;
public void startApp() {
if (mgc == null) {
mgc = new Start();
mgc.addCommand(new Command("开始", Command.OK, 1));
mgc.addCommand(new Command("结束", Command.EXIT, 2));
mgc.setCommandListener(this);
display.setCurrent(mgc);
}
}
public void commandAction(Command c, Displayable s) {
String cmd = c.getLabel();
if (cmd.equals("开始")) {
mgc.start();
} else if (cmd.equals("结束")) {
mgc.exit();
notifyDestroyed();
}
}
public void pauseApp() {
}
public void destroyApp(boolean unconditional) {
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -