import javax.microedition.midlet.*; import javax.microedition.lcdui.*; public class HelloClass extends MIDlet implements CommandListener { Display d = Display.getDisplay(this); private Command exit = new Command("exit",Command.EXIT,0); public void startApp() { HelloCanvas Canv = new HelloCanvas(); Canv.addCommand(exit); Canv.setCommandListener(this); d.setCurrent(Canv); } public void pauseApp() { } public void destroyApp(boolean u) { notifiDestroyed(); } public void commandAction(Command command,Displayable displayable) { if(command == exit){ destroyApp(false); } }