import javax.microedition.midlet.*; import javax.microedition.lcdui.*; public class MainClassGauge extends MIDlet implements CommandListener { private Command exitMidlet = new Command("Выход", Command.EXIT, 1); private Form myform = new Form(" Форма"); private Display mydisplay; public MainClassGauge() { mydisplay = Display.getDisplay(this); } public void startApp() { myform.append(new Gauge(" Уровень: ", true, 10, 0 )); myform.addCommand(exitMidlet); 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(); } } }