📄 interactivegaugemidlet.java
字号:
package com.j2medev.sample.chapter3;
import javax.microedition.midlet.*;
import javax.microedition.lcdui.*;
public class InteractiveGaugeMidlet extends MIDlet implements ItemCommandListener {
private Gauge gauge = new Gauge("音量调节", true, 5, 0);
private Form form = new Form("UIDemo");
private Display display = null;
private Command addCommand = new Command("增加",Command.OK,1);
public void startApp() {
if(display==null) {
form.append(gauge);
display = Display.getDisplay(this);
gauge.addCommand(addCommand);
gauge.setItemCommandListener(this);
}
display.setCurrent(form);
}
public void pauseApp() {
}
public void destroyApp(boolean unconditional) {
}
public void commandAction(Command cmd,Item item){
if(cmd == addCommand){
if(item == gauge){
gauge.setValue(gauge.getValue()+1);
}
}
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -