displayable1.java

来自「在J2ME中实现虚拟代理」· Java 代码 · 共 48 行

JAVA
48
字号
package mobilevirproxy;

import javax.microedition.lcdui.*;

/**
 * <p>Title: Publish from SRTServer</p>
 * <p>Description: Java</p>
 * <p>Copyright: Copyright (c) 2004</p>
 * <p>Company: Sigma-datas</p>
 * $author$ luweigan
 * $version$ 1.0
 */

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

  private void jbInit() throws Exception {
    // Set up this Displayable to listen to command events
    setCommandListener(this);
    addCommand(new Command("Start", Command.ITEM, 1));
    // 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
      MIDlet1.quitApp();
    }
    else
    if (command.getCommandType() == Command.ITEM) {
// stop the MIDlet
      new VirProxy().start();
    }

  }

}

⌨️ 快捷键说明

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