import javax.microedition.midlet.*; import javax.microedition.lcdui.*; public class Screen extends MIDlet implements CommandListener { private Command exitMidlet; private Command PerexodTextBox; private Command PerexodList; private Command PerexodAlert; private Display mydisplay; /* Constructor */ public Screen() { mydisplay=Display.getDisplay(this); exitMidlet=new Command("Exit",Command.EXIT,1); PerexodTextBox=new Command("Next",Command.SCREEN,2); } public void startApp() { Form myform=new Form("This is Form"); myform.addCommand(exitMidlet); myform.addCommand(PerexodTextBox); myform.setCommandListener(this); mydisplay.setCurrent(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", "TextBox is here",100,0); PerexodList=new Command("Next",Command.SCREEN,2); tb.addCommand(exitMidlet); tb.addCommand(PerexodList); tb.setCommandListener(this); Display.getDisplay(this).setCurrent(tb); } if (c==PerexodList) { List mylist=new List("List",List.IMPLICIT); PerexodAlert=new Command("Next",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","End",null,null); Display.getDisplay(this).setCurrent(myalert); } } }