hellomidlet.java~2~

来自「一个手机的j2me程序。 简单」· JAVA~2~ 代码 · 共 60 行

JAVA~2~
60
字号
package sojiture;

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

/**
 * <p>Title: </p>
 *
 * <p>Description: </p>
 *
 * <p>Copyright: Copyright (c) 2006</p>
 *
 * <p>Company: </p>
 *
 * @author not attributable
 * @version 1.0
 */
public class HelloMIDlet extends MIDlet implements CommandListener//
{
  private Command exitCommand;//
  private Display display;
  //static HelloMIDlet instance;
  //Displayable1 displayable = new Displayable1();
  public HelloMIDlet() {
    //instance = this;
    display = Display.getDisplay(this);//
    exitCommand = new Command("离开",Command.BACK,1);//
  }

  public void startApp() {
    TextBox t = new TextBox("Welcome,my friend.","Forever",256,0);
    t.addCommand(exitCommand);
    t.setCommandListener(this);
    display.setCurrent(t);
    //Display.getDisplay(this).setCurrent(displayable);
  }

  public void pauseApp() {
  }

  public void destroyApp(boolean unconditional) {
  }
  //事件监听
  public void destroyApp(Command c,Displayable s)
  {
    if (c == exitCommand)
    {
      destroyApp(false);
      notifyDestroyed();
    }
  }
/*
  public static void quitApp() {
    instance.destroyApp(true);
    instance.notifyDestroyed();
    instance = null;
  }
*/
}

⌨️ 快捷键说明

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