import javax.microedition.midlet.*; import javax.microedition.lcdui.*; public class Hello extends MIDlet implements CommandListener { private Command exitCommand; private Display mydisplay; public Hello() { mydisplay = Display.getDisplay(this); exitCommand = newCommand("Выход", Command.SCREEN, 2); } public void startApp() { TextBox t = new TextBox("hello","текст",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(); } } }