📄 menuscreen.java
字号:
import javax.microedition.lcdui.*;/** * <p>Title: </p> * <p>Description: </p> * <p>Copyright: Copyright (c) 2004</p> * <p>Company: </p> * @author not attributable * @version 1.0 */public class menuScreen extends Canvas implements CommandListener{ gameMIDlet gameMid; gameScreen game; Command playCommand = new Command("开始", Command.ITEM, 1); Command exitCommand = new Command("退出", Command.EXIT, 1); private Display display; private Image img; public menuScreen(Display display, Image img, gameMIDlet gameMid) { this.display = display; this.img = img; this.gameMid = gameMid; addCommand(playCommand); addCommand(exitCommand); setCommandListener(this); } protected void paint(Graphics g) { /**@todo Implement this javax.microedition.lcdui.Canvas abstract method*/ g.setColor(0x00FFFFFF); g.fillRect(0, 0, getWidth(), getHeight()); g.setColor(0x00000000); g.drawImage(img, getWidth()/2, getHeight()/2-5, 3); } public void commandAction(Command c, Displayable d) { if (c == playCommand) { game = null; game = new gameScreen(display, this); game.start(); display.setCurrent(game); } else if (c == exitCommand) { game = null; gameMid.destroyApp(true); gameMid.notifyDestroyed(); } }}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -