/* Hello MIDP Ver 0.00 */ /* */ /* */ /* by Atsushi 2000/7/17 */ import javax.microedition.lcdui.*; import javax.microedition.midlet.*; public class Hello extends MIDlet implements CommandListener { /* --- Field --- */ private Display display; private Command exit; /* --- Constructor --- */ public Hello() { display=Display.getDisplay(this); exit=new Command("Exit",Command.SCREEN,2); } /* --- 開始・終了 --- */ public void startApp() { TextBox text; text=new TextBox("Hello MIDP","Test string",256,0); text.addCommand(exit); text.setListener(this); display.setCurrent(text); } public void pauseApp() { } public void destroyApp(boolean unconditional) { } /* --- イベント --- */ public void commandAction(Command c,Displayable s) { if (c==exit) { destroyApp(false); notifyDestroyed(); } } }