?? alertmidlet.java
字號:
package com.j2medev.sample.chapter3;
import javax.microedition.midlet.*;
import javax.microedition.lcdui.*;
public class AlertMidlet extends MIDlet implements CommandListener {
private Display display = null;
private Alert confirm = new Alert("確認", "一些確認信息", null, AlertType.CONFIRMATION);
private Alert error = new Alert("錯誤", "一些錯誤信息", null, AlertType.ERROR);
private List menu = new List("UIDemo", List.IMPLICIT, new String[]{"AlertType.CONFIRMATION類型", "AlertType.ERROR類型"}, null);
public void startApp() {
if(display==null) {
display = Display.getDisplay(this);
menu.setCommandListener(this);
}
display.setCurrent(menu);
}
public void pauseApp() {
}
public void destroyApp(boolean unconditional) {
}
public void commandAction(Command cmd, Displayable d) {
if(cmd==List.SELECT_COMMAND) {
if(menu.getSelectedIndex()==0)
display.setCurrent(confirm);
if(menu.getSelectedIndex()==1)
display.setCurrent(error);
}
}
}
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -