e027d089f251001f185d87389a1c119f
上传用户:anders
上传日期:2022-07-15
资源大小:376k
文件大小:1k
- package phoneLeter;
- import javax.microedition.lcdui.Command;
- import javax.microedition.lcdui.CommandListener;
- import javax.microedition.lcdui.Displayable;
- import javax.microedition.lcdui.Form;
- import javax.microedition.lcdui.TextField;
- public class addPhone extends Form implements CommandListener {
- private Command cmdOk=new Command("确定添加",Command.OK,1);
- private Command cmdBack=new Command("返回",Command.SCREEN,1);
- private phoneMIDlet pm;
- private TextField tfName=new TextField("",10,T);
-
- public addPhone(phoneMIDlet pm)
- {
- super("添加电话号码");
- this.pm=pm;
- this.addCommand(cmdOk);
- this.addCommand(cmdBack);
- this.setCommandListener(this);
- }
- public void commandAction(Command arg0, Displayable arg1) {
- if(arg0==cmdOk)
- {
- //添加电话界面,并返回通讯录界面
- //.....添加电话
- pm.changeInterface("phoneList");
- }
- else if(arg0==cmdBack)
- {
- //返回电话本界面
- pm.changeInterface("phoneList");
- }
- }
- }