?? welcome.java
字號:
package com.j2medev.chapter3.splash;
import javax.microedition.midlet.*;
import javax.microedition.lcdui.*;
public class Welcome extends MIDlet implements CommandListener{
private Display display = null;
String[] elements = new String[]{"閱讀文章","拍照上傳","推薦WAP站點"};
private List main = new List("主菜單",List.IMPLICIT, elements,null);
private Command exitCommand = new Command("退出",Command.EXIT, 1);
public void startApp() {
if(display == null){
display = Display.getDisplay(this);
main.addCommand(exitCommand);
main.setCommandListener(this);
//初始化SplashCanvas
SplashCanvas splash = new SplashCanvas(this, main);
//顯示歡迎界面
display.setCurrent(splash);
}else{
display.setCurrent(main);
}
}
public void pauseApp() {
}
public void destroyApp(boolean unconditional) {
}
public void setCurrent(Displayable displayable){
display.setCurrent(displayable);
}
//退出應用程序
public void commandAction(Command cmd,Displayable displayable){
if(cmd == exitCommand){
destroyApp(false);
notifyDestroyed();
}
}
}
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -