package helloworld; import javax.microedition.midlet.*; import javax.microedition.icdui.*; public class HelloWorld extends MIDlet implements CommandListener { private Command exit; private Display mydisplay; public HelloWorld() { mydisplay = Display.getDisplay(this); exit = new Command("Выхад", Command.SCREEN, 2); } public void startApp() { TextBox t = new TextBox("HelloWorld koroch","Ji est",256,0); t.addCommand(exit); t.setCommandListener(this); mydisplay.setCurrent(t); } public void pauseApp() { } public void destroyApp(boolean unconditional) { } public void commandAction(Command c, Displayable s) { if (c == exit) { destroyApp(false); notifyDestroyed(); } } }