?? options.java
字號:
/* * @(#)Options.java 1.3 04/01/27 * * Copyright (c) 2000-2004 Sun Microsystems, Inc. All rights reserved. * PROPRIETARY/CONFIDENTIAL * Use is subject to license terms */import javax.microedition.lcdui.*;public class Options extends Form implements CommandListener { int level; Command ok; Command cancel; Display dpy; Displayable prev; ChoiceGroup cg1; Options(Display dpy_, Displayable prev_) { super("Options"); dpy = dpy_; prev = prev_; // set up default values level= 0; // REMIND should use a label here //append("Choise level:"); cg1 = new ChoiceGroup("Choise level:", Choice.EXCLUSIVE); cg1.append("Level 1", null); cg1.append("Level 2", null);
cg1.append("Level 3", null); append(cg1); loadUI(); ok = new Command("OK", Command.OK, 0); cancel = new Command("Cancel", Command.CANCEL, 1); addCommand(ok); addCommand(cancel); setCommandListener(this); } public void commandAction(Command c, Displayable d) { if (c == ok) { readUI(); } else if (c == cancel) { loadUI(); } dpy.setCurrent(prev); } void loadUI() { cg1.setSelectedIndex(level, true); } void readUI() { level = cg1.getSelectedIndex(); }}
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -