import javax.microedition.midlet.MIDlet;
import javax.microedition.lcdui.*;
public class TextFieldTest extends MIDlet implements CommandListener {
private Display display;
private Form form;
private Command exitCommand;
private TextField text1;
public void startApp() {
display=Display.getDisplay(this);
form=new Form("");
text1=new TextField("","",50,TextField.ANY);
text1.setPreferredSize(100,200);
form.append(text1);
exitCommand=new Command("Exit",Command.EXIT,0);
form.addCommand(exitCommand);
form.setCommandListener(this);
display.setCurrent(form);
}
protected void pauseApp() {
}
protected void destroyApp(boolean arg0) {
}
public void commandAction(Command c, Displayable s) {
if (c == exitCommand) {
destroyApp(true);
notifyDestroyed();
}
}
}
No comments:
Post a Comment