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

public class HelloMIDlet extends MIDlet implements CommandListener {
  private Command exitCommand; 
  private Display display; 
  TextBox t = null;

  public HelloMIDlet() {
    display = Display.getDisplay(this);
    exitCommand = new Command("Exit", Command.SCREEN, 2);
  }

  public void startApp() {
    t = new TextBox("hello, world", "Shall we play a game?", 256, 0);
    t.addCommand(exitCommand);
    t.setCommandListener(this);
    display.setCurrent(t);
  }

  public void pauseApp() { }

  public void destroyApp(boolean unconditional) { }

  public void commandAction(Command c, Displayable s) {
    if (c == exitCommand) {
      destroyApp(false);
      notifyDestroyed();
    }
  }
}

