留个纪念:
package j2me;
import javax.microedition.lcdui.Command;
import javax.microedition.lcdui.CommandListener;
import javax.microedition.lcdui.Display;
import javax.microedition.lcdui.Displayable;
import javax.microedition.lcdui.List;
import javax.microedition.lcdui.TextBox;
import javax.microedition.lcdui.TextField;
import javax.microedition.midlet.MIDlet;
import javax.microedition.midlet.MIDletStateChangeException;
public class j2me1 extends MIDlet implements CommandListener {
Display display = null;
public j2me1() {
// TODO Auto-generated constructor stub
}
protected void destroyApp(boolean arg0) throws MIDletStateChangeException {
// TODO Auto-generated method stub
}
protected void pauseApp() {
// TODO Auto-generated method stub
}
protected void startApp() throws MIDletStateChangeException {
display = Display.getDisplay(this);
TextBox edit = new TextBox("edit tile", "", 10, TextField.ANY);
System.out.println("最大值是:" + edit.getMaxSize());
edit.addCommand(new Command("确定", Command.OK, 1));
edit.setCommandListener(this);
display.setCurrent(edit);
}
public void commandAction(Command command, Displayable displayable) {
System.out.println(((TextBox) displayable).getString());
}
}