import javax.microedition.midlet.*; import javax.microedition.lcdui.*; /** * @author treut */ public class Forma extends MIDlet implements CommandListener { Form f; //Form Display d; //Display private Command ok2 = new Command("OK2", Command.OK, 2); //Command Command ok; static TextField tb; //TextBox public void startApp() { f = new Form("treut"); //new Form f.append("B " +tb); //Text ok = new Command("OK", Command.OK, 1); f.addCommand(ok); f.setCommandListener(this); d = Display.getDisplay(this); d.setCurrent(f); } public void pauseApp() { } public void destroyApp(boolean unconditional) { } public void commandAction(Command c, Displayable d) { if(c == ok) { tb = new TextField("tbOX", "integ", 8, TextField.ANY); tb.addCommand(ok2); tb.setCommandListener(this); d.setCurrent(tb); } if(c == ok2) { d.setCurrent(f); } } }