📄 mytest3.java
字号:
package mytest3;
import javax.microedition.midlet.MIDlet;
import javax.microedition.midlet.MIDletStateChangeException;
import javax.microedition.lcdui.*;
public class mytest3 extends MIDlet implements CommandListener {
Display display;
Form frm = new Form("lianxi");
Command cmd1 = new Command("open",Command.OK,0);
Command cmd2 = new Command("cancel",Command.EXIT,1);
Command cmd3 = new Command("back",Command.BACK,0);
public mytest3() {
super();
// TODO 自动生成构造函数存根
}
protected void destroyApp(boolean arg0) throws MIDletStateChangeException {
// TODO 自动生成方法存根
}
protected void pauseApp() {
// TODO 自动生成方法存根
}
protected void startApp() throws MIDletStateChangeException {
display = Display.getDisplay(this);
System.out.println(display.numColors());
System.out.println(display.isColor());
frm.addCommand(cmd1);
frm.addCommand(cmd2);
frm.addCommand(cmd3);
frm.setCommandListener(this);
display.setCurrent(frm);
// TODO 自动生成方法存根
}
public void commandAction(Command c,Displayable d){
if(c == cmd1)
notifyDestroyed();
if(c == cmd2)
frm.append(c.getLabel()+"按下");
else
frm.append(c.getLabel()+"按下");
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -