mb.java

来自「非富多彩的十六个J2ME的例子」· Java 代码 · 共 40 行

JAVA
40
字号
import javax.microedition.midlet.*;
import javax.microedition.lcdui.*;
public class MB extends MIDlet implements CommandListener
{
	private Display dis;
	private Form frm;
	private Command cmdexit;
  public MB()
  {
  	dis=Display.getDisplay(this);
  	frm=new Form("MB");
  	StringItem str=new StringItem("hello word","");
  	frm.append(str);
  	cmdexit=new Command("Exit",Command.OK,0);
  	frm.addCommand(cmdexit);
  	frm.setCommandListener(this);
  }	
  
  public void commandAction(Command c, Displayable d)
  {
  	if(c==cmdexit)
  	   destroyApp(true);
  	
  } 
 
  
  public void startApp() throws MIDletStateChangeException
  {
  	dis.setCurrent(frm);
    	
  }
  
  public void destroyApp(boolean unconditional) 
  {
     notifyDestroyed();	
  }
  public  void pauseApp() 
  {} 
 
}

⌨️ 快捷键说明

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