import java.io.*; import javax.microedition.midlet.*; import javax.microedition.lcdui.*; public class Massor extends MIDlet implements CommandListener { private Display displayen; private Form formuläret; private Command exitkommandot; private int antalet = 0; private Item latest = null; public Massor() { formuläret = new Form("En massa mätare och en massa textfält"); for (int i=0; i <1000; ++i) { Gauge g = new Gauge("Ställ in", true, 5, 3); formuläret.append(g); StringItem s = new StringItem("Värde " + (++antalet) + ":", "3"); formuläret.append(s); latest = s; } exitkommandot = new Command("Avsluta", Command.EXIT, 0); formuläret.addCommand(exitkommandot); formuläret.setCommandListener(this); } public void startApp() { displayen = Display.getDisplay(this); displayen.setCurrent(formuläret); displayen.setCurrentItem(latest); } public void commandAction(Command kommandot, Displayable s) { if (kommandot == exitkommandot) { destroyApp(false); notifyDestroyed(); } } public void destroyApp(boolean unconditional) { } public void pauseApp() { } } // class Massor