?? stopwatchmain.java
字號:
package phone.function.secondWatch;
import javax.microedition.lcdui.Command;
import javax.microedition.lcdui.CommandListener;
import javax.microedition.lcdui.Display;
import javax.microedition.lcdui.Displayable;
import javax.microedition.lcdui.Form;
import javax.microedition.lcdui.TextField;
import javax.microedition.midlet.MIDlet;
import javax.microedition.midlet.MIDletStateChangeException;
import phone.MainMIDlet;
import phone.function.list.FunctionList;
public class StopwatchMain extends Form implements CommandListener {
/**
* @author Hou Liang Wei
* @deprecated 創建了一個Form表單的對象form;按鈕Command的對象exit表示推出整個程序, ok進入秒表的界面,
* exitWatch退出秒表的界面, start啟動秒表, stop停止秒表
* @see time:2009-3-4-16:43
*/
private Display display;
private Command back, ok, exitWatch, start, stop;
private Watch watch;
private FunctionList fl;
public StopwatchMain(FunctionList fl, Display display) {
super("秒表");
this.display = display;
this.fl = fl;
back = new Command("back", Command.EXIT, 1);
ok = new Command("ok", Command.OK, 1);
exitWatch = new Command("exitWatch", Command.CANCEL, 1);
start = new Command("start", Command.OK, 1);
stop = new Command("stop", Command.STOP, 1);
this.addCommand(back);
this.addCommand(ok);
this.setCommandListener(this);
this.append("爭分奪秒");
}
/** 實現CommandListener接口中的方法 */
public void commandAction(Command command, Displayable arg1) {
if (command == start) {
watch.removeCommand(start);
watch.addCommand(stop);
watch.startWatch();
}
if (command == stop) {
watch.end();
watch.removeCommand(stop);
watch.addCommand(start);
}
if (command == exitWatch) {
display.setCurrent(this);
}
if (command == back) {
fl.getList();
}
if (command == ok) {
watch = new Watch();
watch.addCommand(exitWatch);
watch.addCommand(start);
watch.setCommandListener(this);
display.setCurrent(watch);
}
}
}
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -