📄 setmobileform.java
字号:
package main;
import javax.microedition.lcdui.*;
public class SetMobileForm implements CommandListener{
private Midlet midlet=null;
private Main main=null;
public SetMobileForm(Midlet midlet,Main main)
{
this.midlet=midlet;
this.main=main;
Display.getDisplay(midlet).setCurrent(form);
form.append(textField);
form.addCommand(returnCommand);
form.addCommand(saveCommand);
form.setCommandListener(this);
}
Form form=new Form("设置手机号");
Command returnCommand=new Command("return",Command.OK,1);
Command saveCommand=new Command("save",Command.OK,1);
TextField textField=new TextField("",Main.mobile,11,TextField.ANY);
public void commandAction(Command cmd, Displayable arg1) {
if (cmd==returnCommand)
{
Display.getDisplay(midlet).setCurrent(main);
}
if (cmd==saveCommand)
{
String mobile=textField.getString();
main.mobile=mobile;
RMS.save(mobile);
}
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -