?? mainmenu.java
字號:
package com.j2medev.chapter3;
import javax.microedition.lcdui.*;
public class MainMenu extends List implements CommandListener{
public static final String[] item = new String[]{"New Article","New Picture","Settings","About us"};
public MainMenu() {
super("MainMenu",List.IMPLICIT,item,null);
setCommandListener(this);
}
public void commandAction(Command cmd,Displayable displayable){
if(cmd == List.SELECT_COMMAND){
String label = getString(getSelectedIndex());
if(label.equals(item[0])){
StackMIDlet.moveNext(new ArticleForm());
}else if(label.equals(item[1])){
//do nothing here
}else if(label.equals(item[2])){
//do nothing here
}else if(label.equals(item[3])){
StackMIDlet.moveNext(new AboutForm());
}
}else if(cmd.getCommandType()==Command.EXIT || cmd.getCommandType()==Command.BACK){
StackMIDlet.handleCommandAction(cmd,displayable);
}
}
}
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -