import javax.microedition.midlet.*; import javax.microedition.lcdui.*; public class Midlet extends MIDlet implements CommandListener { private Command exitCom = new Command("Выход", Command.EXIT,0); private Command nextCom= new Command("Refresh",Command.SCREEN,0); Display d; Form f; Gauge g; public void startApp() { d = Display.getDisplay(this); f = new Form("Hello"); f.append("Troll :D"); f.append(new TextField("Метку","Текст",20,TextField.ANY)); f.addCommand(exitCom); f.addCommand(nextCom); f.setCommandListener(this); g = new Gauge("Num Item selected:", false, 10, 1); f.append(g); d.setCurrent(f); } public void pauseApp() { } public void destroyApp(boolean unconditional) { } public void commandAction(Command c, Displayable d) { if (c == exitCom) { destroyApp(false); notifyDestroyed(); } if (c == nextCom) { f = new Form("ololo"); f.append(new TextField("Метку","Текст",20,TextField.ANY)); f.append(new TextField("Метку","Текст",20,TextField.ANY)); f.append(new TextField("Метку","Текст",20,TextField.ANY)); g = new Gauge("Num Item selected:", false, f.size(), 2); f.append(g); f.addCommand(exitCom); f.addCommand(nextCom); f.setCommandListener(this); d.setCurrent(f); } } }