about.java~5~

来自「名字为《单身贵族》的游戏」· JAVA~5~ 代码 · 共 58 行

JAVA~5~
58
字号
package genius.game.mobile.bachelor;

import javax.microedition.lcdui.*;

/**
 * <p>Title: GENIUS bachelor</p>
 * <p>Description: GENIUS Mobile Game - Bachelor</p>
 * <p>Copyright: Copyright (c) 2002 GENIUS Tech.</p>
 * <p>Company: GENIUS Technology Software Development Union.</p>
 * @author Rodger hu
 * @version 1.01
 */
public class about extends Canvas implements CommandListener {
  private Displayable parentDisplayable;
  private Command cmdExit = new Command("退出", Command.EXIT, 1);

  /**Construct the displayable*/
  public about() {
    try {
      jbInit();
    }
    catch(Exception e) {
      e.printStackTrace();
    }
  }

  /**Component initialization*/
  private void jbInit() throws Exception {
    // set up this Displayable to listen to command events
    setCommandListener(this);
    // add the Exit command
    addCommand(cmdExit);
  }

  /**Handle command events*/
  public void commandAction(Command command, Displayable displayable) {
    if (command == cmdExit) {
      Display.getDisplay(mainGame.instance).setCurrent(parentDisplayable);
    }
  }

  /** Required paint implementation */
  protected void paint(Graphics g) {
    /** @todo Add paint codes */
  }

  public void setParent(Displayable displayable) {
    if (displayable == null)
    {
      Alert a = new Alert("Error");
      a.setString("The displayable == null");
      a.setTimeout(2000);
      Display.getDisplay(mainGame.instance).setCurrent(a);
    }
    parentDisplayable = displayable;
  }
}

⌨️ 快捷键说明

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