import javax.microedition.midlet.*; import javax.microedition.lcdui.*; public class Joonistus2 extends MIDlet implements CommandListener{ Canvas louend1=new Louend1(); Canvas louend2=new Louend2(); Command c1=new Command("Esimene", Command.ITEM, 1); Command c2=new Command("Teine", Command.ITEM, 1); public Joonistus2(){ louend1.addCommand(c2); louend2.addCommand(c1); louend1.setCommandListener(this); louend2.setCommandListener(this); } protected void startApp() throws MIDletStateChangeException{ Display.getDisplay(this).setCurrent(louend1); } protected void pauseApp(){} protected void destroyApp(boolean kohustus) throws MIDletStateChangeException{} public void commandAction(Command c, Displayable d){ if(c==c1){Display.getDisplay(this).setCurrent(louend1);} if(c==c2){Display.getDisplay(this).setCurrent(louend2);} } }