📄 gaugemidlet.java
字号:
import javax.microedition.midlet.*;
import javax.microedition.lcdui.*;
public class GaugeMIDlet extends MIDlet implements CommandListener {
private Command exitComm;
private Gauge activeGauge;
private Gauge inactiveGauge;
private Display display;
public GaugeMIDlet() {
display = Display.getDisplay(this);
exitComm = new Command("离开", Command.EXIT, 1);
activeGauge = new Gauge("可调整:", true, 10, 2);
inactiveGauge = new Gauge("不可调整:", false, 10, 4);
}
public void startApp() {
Form form = new Form("Gauge 示范");
form.append(activeGauge);
form.append(inactiveGauge);
form.addCommand(exitComm);
form.setCommandListener(this);
display.setCurrent(form);
}
public void pauseApp() {}
public void destroyApp(boolean unconditional) {}
public void commandAction(Command c, Displayable s) {
String comm = c.getLabel();
if (comm.equals("离开")) {
destroyApp(false);
notifyDestroyed();
}
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -