📄 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 + -