?? mainmidlet.java
字號:
import javax.microedition.lcdui.Choice;
import javax.microedition.lcdui.Command;
import javax.microedition.lcdui.CommandListener;
import javax.microedition.lcdui.Display;
import javax.microedition.lcdui.Displayable;
import javax.microedition.lcdui.Image;
import javax.microedition.lcdui.List;
import javax.microedition.midlet.MIDlet;
import javax.microedition.midlet.MIDletStateChangeException;
import javax.microedition.rms.RecordStore;
public class MainMIDlet extends MIDlet implements CommandListener {
private final static Command exitCommand = new Command("推出", Command.EXIT,
1);
private final static Command confirmCommand = new Command("確認",
Command.SCREEN, 1);
private Display display;
private List mainList;
private RecordStore rs;
public MainMIDlet() {
super();
display = this.display.getDisplay(this);
// TODO Auto-generated constructor stub
}
protected void startApp() throws MIDletStateChangeException {
Image[] imageArray = null;
try {
Image icon = Image.createImage("/pic/choose.png");
imageArray = new Image[] { icon, icon, icon, icon };
} catch (java.io.IOException e) {
imageArray = null;
}
String[] StringArray ={"添加新記錄","瀏覽電話薄","查找記錄","刪除記錄"};
mainList = new List("電話本",Choice.IMPLICIT,StringArray,imageArray);
mainList.addCommand(exitCommand);
mainList.addCommand(confirmCommand);
mainList.setCommandListener(this);
display.setCurrent(mainList);
}
protected void pauseApp() {
// TODO Auto-generated method stub
}
protected void destroyApp(boolean arg0) throws MIDletStateChangeException {
// TODO Auto-generated method stub
}
public void commandAction(Command arg0, Displayable arg1) {
// TODO Auto-generated method stub
}
}
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -