?? ui_low3.java
字號:
// 程序名UI_Low3.java
// 測試按鍵事件
import javax.microedition.midlet.*;
import javax.microedition.lcdui.*;
public class UI_Low3 extends MIDlet implements CommandListener{
private Display display;
private MyCanvas canvas;
private Command cmdExit;
public UI_Low3(){
display = Display.getDisplay( this );
canvas = new MyCanvas( this );
cmdExit = new Command("Exit",Command.SCREEN,1);
//canvas.addCommand(cmdExit);
canvas.setCommandListener(this);
}
protected void startApp(){
display.setCurrent( canvas );
System.out.println("if the device supports pointer events: "+canvas.hasPointerEvents());
System.out.println("if the device supports pointer dragged events: "+canvas.hasPointerMotionEvents());
}
protected void pauseApp(){
}
protected void destroyApp( boolean unconditional ){
}
public void commandAction( Command c, Displayable d ){
if (c == cmdExit){
exit();
}
}
public void exit(){
destroyApp( true );
notifyDestroyed();
}
}
?? 快捷鍵說明
復(fù)制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -