?? ui_low9.java
字號:
// 程序名UI_Low9.java
// 測試測試絕對坐標
import javax.microedition.midlet.*;
import javax.microedition.lcdui.*;
public class UI_Low9 extends MIDlet implements CommandListener{
private Display display;
private PigCanvas canvas; //構造一個PigCanvas對象
private Command cmdExit;
public UI_Low9(){
display = Display.getDisplay( this );
canvas = new PigCanvas( this ); //構造一個PigCanvas對象
cmdExit = new Command("Exit",Command.SCREEN,1);
canvas.addCommand(cmdExit);
canvas.setCommandListener(this);
}
protected void startApp(){
display.setCurrent( canvas ); //把Canvas對象設置為當前屏幕
}
protected void pauseApp(){
}
protected void destroyApp( boolean unconditional ){
}
public void commandAction( Command c, Displayable d ){
if (c == cmdExit){
exit();
}
}
public void exit(){ //單獨實現一個exit()方法,目的是讓Canvas對象也能方便調用
destroyApp(true);
notifyDestroyed();
}
}
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -