import javax.microedition.midlet.*; import javax.microedition.lcdui.*; public class Date extends MIDlet implements CommandListener { private Command exitMidlet = new Command("Выход", Command.EXIT, 1); private DateField dt; private Form mf; private Display md; public Date() { md = Display.getDisplay(this); } public void startApp() { dt = new DateField("Дата и время", DateField.DATE_TIME); mf = new Form("Встроенный DateField"); mf.append("dt"); mf.addCommand(exitMidlet); mf.setCommandListener(this); md.setCurrent(mf); } public void pauseApp() { } public void destroyApp(boolean unconditional) { } public void commandAction(Command c, Displayable d) { if (c == exitMidlet) { destroyApp(false); notifyDestroyed(); } } }