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

📄 helloform.java

📁 本人写的第一款J2ME手机游戏
💻 JAVA
字号:
package firstj2me;

import javax.microedition.lcdui.*;

public class HelloForm extends Form implements CommandListener {
  public HelloForm() {
    super("HelloBaby");
    try {
      jbInit();
    }
    catch(Exception e) {
      e.printStackTrace();
    }
  }

  private void jbInit() throws Exception {
    // Set up this Displayable to listen to command events
    setCommandListener(this);
    // add the Exit command
    addCommand(new Command("Exit", Command.EXIT, 1));
  }

  public void commandAction(Command command, Displayable displayable) {
    /** @todo Add command handling code */
    if (command.getCommandType() == Command.EXIT) {
// stop the MIDlet
      HelloWorldMIDlet.helloInstance.destroyApp(true);
      HelloWorldMIDlet.helloInstance.notifyDestroyed();
      HelloWorldMIDlet.helloInstance = null;
    }
  }

}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -