import javax.microedition.midlet.*; import javax.microedition.lcdui.*; public class Midlet extends Perexod implements CommandListener { private Command exitMidlet; private Command perexodTextBox; private Command perexodList; private Command perexodAlert; private Display mydisplay; public void Perexod(){ mydisplay = Display.getDisplay(this); exitMidlet = new Command("Exit",Command.EXIT,1); perexodTextBox = new Command("TextBox",Command.SCREEN,2); } public void startApp() { Form myform = new Form("this is object form"); myform.addCommand(exitMidlet); myform.addCommand(perexodTextBox); myform.setCommandListener(this); mydisplaysetCurrent(myform); } public void pauseApp() { } public void destroyApp(boolean unconditional) { }public void CommandAction(Command c,Displayable d){ if (c == exitMidlet) { destroyApp(false); notifyDestroyed(); if (c == perexodTextBox) { TextBox tb = new TextBox("TextBox","text",256,0); perexodList = new Command("perexod",Command.SCREEN,2); tb.addCommand(perexodMidlet); tb.addCommand(perexodList); tb.setCommandListener(this); Display.getDisplay(this).setCurrent(tb); } if (c == perexodLit) { List mylist = new List("List",List.IMPLICIT); perexodAlert = new Command("perexod",Command.SCREEN,2);mylist.addCommand(exitMidlet); mylist.addCommand(perexodAlert); mylist.setCommandListener(this); Display.getDisplay(this).setCurrent(mylist); } if (c == perexodAlert) { Alert myalert = new Alert("Alert","xz",null,null); Display.getDisplay(this).setCurrent(myalert); }}}