displayable.java~3~

来自「基于J2ME 技术,开发的一个简单的手机程序.对于初学者有极大的帮助」· JAVA~3~ 代码 · 共 40 行

JAVA~3~
40
字号
package wh;

import javax.microedition.lcdui.*;
import javax.microedition.lcdui.*;

abstract public class Displayable extends Form implements CommandListener {
  /** Constructor */
  public Displayable() {
    super("Displayable Title");
    try {
      jbInit();
    }
    catch(Exception e) {
      e.printStackTrace();
    }
  }

  /**Component initialization*/
  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));
  }

  /**Handle command events*/
  public void commandAction(Command command, Displayable displayable) {
    /** @todo Add command handling code */
    if (command.getCommandType() == Command.EXIT) {
// stop the MIDlet

    }
  }

  public void commandAction(Command command, Displayable displayable) {
  }


}

⌨️ 快捷键说明

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