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