📄 textfieldmidlet.java
字号:
import javax.microedition.midlet.*;
import javax.microedition.lcdui.*;
// A first MIDlet with simple text and a few commands.
public class TextFieldMIDlet extends MIDlet implements CommandListener{
private Command exitCommand;
private TextField aTextField;
private Display display;
public TextFieldMIDlet() {
display = Display.getDisplay(this);
exitCommand = new Command("离开", Command.EXIT, 1);
aTextField = new TextField("标签","内容",4,TextField.ANY);
}
public void startApp() {
Form aForm = new Form("TextField示范");
aForm.append(aTextField);
aForm.addCommand(exitCommand);
aForm.setCommandListener(this);
display.setCurrent(aForm);
}
public void pauseApp() { }
public void destroyApp(boolean unconditional) { }
public void commandAction(Command c, Displayable s) {
if (c == exitCommand) {
destroyApp(false);
notifyDestroyed();
}
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -