hello2.java

来自「此文件是关于手机游戏开发的理论」· Java 代码 · 共 34 行

JAVA
34
字号

import javax.microedition.midlet.MIDletStateChangeException;
import javax.microedition.lcdui.*;

/**
 * Another basic MIDlet used primarily to demonstrate how multiple MIDlets make
 * up a MIDlet Suite. This class extends the existing Hello class and overides
 * the constructor so it displays different content in the Form.
 * 
 * @author Martin J. Wells
 */

public class Hello2 extends Hello
{
   /**
    * Constructor for the MIDlet which instantiates the Form object and
    * then adds a text message. It then sets up a command listener so it
    * will get called back when the user hits the quit command. Note that this
    * Form is not activated (displayed) until the startApp method is called.
    */

   public Hello2()
   {
      // create a form and add our text
      form = new Form("My 2nd Midlet");
      form.append("Hello, to another Micro World!");

      // create a way to quit
      form.setCommandListener(this);
      quit = new Command("Quit", Command.SCREEN, 1);
      form.addCommand(quit);
   }
}

⌨️ 快捷键说明

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