📄 gaugedemo2.java
字号:
//gaugeDemo2.java file
import javax.microedition.lcdui.*;
import javax.microedition.midlet.*;
import itemex.*;
public class gaugeDemo2 extends MIDlet implements CommandListener
{
private Command exitCommand;
private Form form;
public gaugeDemo2()
{
exitCommand =new Command("Exit",Command.EXIT,1);
form = new Form("gauge form 2");
form.addCommand(exitCommand);
//设置命令监听对象
form.setCommandListener(this);
form.append(new Gauge("INCREMENTAL_IDLE",false,Gauge.INDEFINITE, Gauge.INCREMENTAL_IDLE));
form.append(new Gauge("CONTINUOUS_IDLE",false,Gauge.INDEFINITE, Gauge.CONTINUOUS_IDLE));
form.append(new Gauge("RUNNING",false,Gauge.INDEFINITE, Gauge.CONTINUOUS_RUNNING));
form.append(new AutoUpdateGauge("UPDATING",1000));
//调整布局方式
form.get(0).setLayout(Item.LAYOUT_SHRINK| Item.LAYOUT_2);
form.get(1).setLayout(Item.LAYOUT_SHRINK| Item.LAYOUT_2|Item.LAYOUT_NEWLINE_AFTER);
form.get(2).setLayout(Item.LAYOUT_SHRINK| Item.LAYOUT_2);
form.get(3).setLayout(Item.LAYOUT_SHRINK| Item.LAYOUT_2|Item.LAYOUT_NEWLINE_AFTER);
}
protected void startApp( ) throws MIDletStateChangeException
{
Display.getDisplay(this).setCurrent(form);
}
protected void pauseApp( )
{
}
protected void destroyApp( boolean p1 )
{
}
public void commandAction(Command c,Displayable d)
{
if (c ==exitCommand)
{
destroyApp(false);
notifyDestroyed();
}
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -