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

📄 predisplayable.java

📁 《Java程序设计实践教程》代码
💻 JAVA
字号:
/***************************************************
*  程序文件名称: preDisplayable.java
*  功能:显示前一次所查询信息的结果情况
***************************************************/
import javax.microedition.lcdui.*;
import javax.microedition.midlet.*;

public class preDisplayable extends TextBox implements CommandListener {
  private Command backCommand;
  private Command newCommand;
  private String info;
  public preDisplayable(){
    super("查询结果","",100,TextField.UNEDITABLE);
    try {
      jbInit();
    }
    catch(Exception e) {
      e.printStackTrace();
    }
    info = "";
  }

  private void jbInit() throws Exception {
    // Set up this Displayable to listen to command events
    setCommandListener(this);
    // add the Exit command
    backCommand =new Command("返回", Command.EXIT, 1);
    newCommand = new Command("查询",Command.OK,1);
    addCommand(backCommand);
    addCommand(newCommand);
    setInfo(getInfo());
  }

  public void commandAction(Command command, Displayable displayable) {
    /** @todo Add command handling code */
    if(command==backCommand){
      Info_client.instance.display.setCurrent(Info_client.instance.displayable);
    }else{
      Info_client.instance.display.setCurrent(Info_client.instance.newDisplay);
    }
  }

  public void setInfo(String s){
    info = s;
    this.setString(info);
  }

  public String getInfo(){
    return "";
  }

}

⌨️ 快捷键说明

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