⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 ui_low3.java

📁 java手机/PDA程序开发与设计用户界面UI_Low3.rar
💻 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();
  }
}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -