?? midletone.java
字號(hào):
import javax.microedition.midlet.*;import javax.microedition.lcdui.*;public class MIDletOne extends MIDlet implements Runnable, CommandListener{ Thread thread; List list; int number = 0; Display display; Command switchCmd; Command exitCmd; boolean first = true; public MIDletOne(){ list = new List("MIDlet One", List.IMPLICIT); list.append("MIDlet One:"+number, null); thread = new Thread(this); switchCmd = new Command("Switch",Command.SCREEN,1); exitCmd = new Command("Exit",Command.EXIT,1); display = Display.getDisplay(this); list.addCommand(switchCmd); list.addCommand(exitCmd); list.setCommandListener(this); } public void startApp(){ if(first){ thread.start(); first = false; } display.setCurrent(list); } public void run(){ while(true){ try{ Thread.sleep(1000); number++; list.set(0,"MIDlet One:"+number, null); }catch(Exception e){} } } public void pauseApp(){ } public void destroyApp(boolean unconditional){ thread = null; } public void commandAction(Command c, Displayable d){ if(c == switchCmd){ pauseApp(); notifyPaused(); resumeRequest(); }else if(c == exitCmd){ destroyApp(false); notifyDestroyed(); } }}
?? 快捷鍵說明
復(fù)制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號(hào)
Ctrl + =
減小字號(hào)
Ctrl + -