📄 gamemidlet.java
字号:
package com.j2medev.chapter5.example;
import javax.microedition.lcdui.Display;
import javax.microedition.midlet.MIDlet;
import javax.microedition.midlet.MIDletStateChangeException;
public class GameMIDlet extends MIDlet {
static GameMIDlet instance;
static Display display;
private GameScreen gameScreen;
public GameMIDlet() {
instance = this;
gameScreen = new GameScreen(false); //产生实例
display = Display.getDisplay(this);
}
protected void startApp() throws MIDletStateChangeException {
gameScreen.start();// 启动线程
display.setCurrent(gameScreen);
}
protected void pauseApp() {
gameScreen.stop();// 停止线程
}
public void destroyApp(boolean flag) throws MIDletStateChangeException {
gameScreen.stop();// 停止线程
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -