import javax.microedition.midlet.*; import javax.microedition.lcdui.*; public class Main extends MIDlet implements CommandListener { public Command exitMidlet; public Display mydisplay; public Main midlet; public canvas canv; public Main(){ exitMidlet = new Command("Exit",Command.SCREEN,2); mydisplay = Display.getDisplay(this); midlet = this; canv = new canvas(); } public void startApp(){ mydisplay.setCurrent(canv); } public void pauseApp(){} public void destroyApp(boolean unconditional){ notifyDestroyed(); } public void commandAction(Command c, Displayable s){ if (c == exitMidlet){ destroyApp(false); notifyDestroyed(); } } }