⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 gamemidlet.java

📁 我编写的第一个算是可以玩的手机游戏请使用wtk2.2,MIDP2.0运行.
💻 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 + -