?? mb.java
字號:
import javax.microedition.midlet.*;
import javax.microedition.lcdui.*;
public class MB extends MIDlet implements CommandListener
{
private Display dis;
private Form frm1,frm2;
private Command cmdexit,cmdok,cmdback;
Ticker tick1,tick2;
public MB()
{
dis=Display.getDisplay(this);
frm1=new Form("MB");
frm2=new Form("back");
StringItem str1=new StringItem("hello word","");
frm1.append(str1);
cmdexit=new Command("Exit",Command.EXIT,2);
frm1.addCommand(cmdexit);
frm1.setCommandListener(this);
frm1.setTicker(tick1);
cmdok=new Command("OK",Command.OK,0);
frm1.addCommand(cmdok);
frm1.setCommandListener(this);
frm1.setTicker(tick1);
//dis.setCurrent(frm1);
StringItem str2=new StringItem("welcome to ","");
cmdback=new Command("Back",Command.BACK,1);
frm2.addCommand(cmdback);
frm2.addCommand(cmdexit);
frm2.setCommandListener(this);
frm2.setTicker(tick2);
dis.setCurrent( frm2);
}
public void commandAction(Command c, Displayable d)
{
if(c==cmdexit)
destroyApp(true);
else if(c==cmdok)
dis.setCurrent(frm2);
else if(c==cmdback)
dis.setCurrent(frm1);
}
public void startApp() throws MIDletStateChangeException
{
dis.setCurrent(frm1);
//dis.setCurrent(frm2);
}
public void destroyApp(boolean unconditional)
{
notifyDestroyed();
}
public void pauseApp()
{}
}
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -