import javax.microedition.midlet.*; import javax.microedition.lcdui.*; public class MainTextField extends MIDlet implements CommandListener { private Command eM = new Command("Выход", Command.EXIT, 0); private Form mf; private Display md; public MainTextField() { md = Display.getDisplay(this); } public void startApp() { Form mf = new Form("TextField"); mf.append(new TextField("Enter your name:", "", 20, TextField.ANY)); mf.append(new TextField("Enter your password:", "", 20, TextField.PASSWORD)); mf.append(new TextField("Enter your URL:", "", 20, TextField.URL)); mf.append(new TextField("Enter your phonenumber:", "", 20, TextField.PHONENUMBER)); mf.addCommand(eM); mf.setCommandListener(this); md.setCurrent(mf); } public void pauseApp() { } public void destroyApp(boolean unconditional) { } public void commandAction(Command c, Displayable d) { if (c == eM) { destroyApp(false); notifyDestroyed(); } } }