package HelloWorld; import javax.microedition.midlet.*; import javax.microedition.lcdui.*; public class HelloWorld extends MIDlet implements CommandListener { private Command exitCommand; private Display mydusplay; public HelloWorld() { mydisplay = Display.getDisplay(this); exitCommand = newCommand("Выход", Command.SCREEN, 2); } public void startApp() { TextBox t = new TextBox("HelloWorld","текст",256, 0); t.addCommand(exitCommand); t.setCommandListener(this); mydisplay.setCurrent(t); } public void pauseApp() {} public void destroyApp(boolean unconditional) {} public void commandAction (Command c, Displayable s); { if.(c == exitCommand) { destroyApp(false); notifyDestroyed(); } } }