JAVA帮忙修改下,小弟先谢了
这是一个基于J2ME的实现手机电话簿功能的程序,有错误,求帮忙修改下,时间很急的.
这是我做的毕业设计,我是学的自动化,却毕业设计做JAVA的 ,比较郁闷
请修改的详细点,或者哪位有电话簿的程序,请贴出来,小弟多谢了,解决问题即给分!
import javax.microedition.lcdui.*;
public class DetailInfo extends Form implements CommandListener
{
private Display display;
private Displayable parent;
private Command backCommand
= new Command("BACK",Command.BACK,1);
private Command deleteCommand
= new Command("Delete",Command.SCREEN,2);
private Command modifyCommand
= new Command("Modify",Command.SCREEN,2);
private StringItem idItem,nameItem,phoneItem;
private PhoneBook pb;
private String stringID;
private int id;
private Friend friend;
private int _id;
private String _name,_phone;
public DetailInfo(Display d,Displayable p,String idAndName)
{
super("Detail Info");
display = d;
parent = p;
addCommand(backCommand);
addCommand(deleteCommand);
addCommand(modifyCommand);
setCommandListener(this);
pb = new PhoneBook();
//get id from idAndName
stringID = idAndName.substring(0,2);
id = Integer.parseInt(stringID);
friend = pb.getFriend(id);
_id = friend.getID();
_name = friend.getName();
_phone = friend.getPhone();
idItem = new StringItem("ID:",_id + "");
nameItem = new StringItem("Name:",_name);
phoneItem = new StringItem("phone:",_phone);
append(idItem);
append(nameItem);
append(phoneItem);
}
public void commandAction(Command c,Displayable s)
{
if(c.getLabel() =="BACK")
{
display.setCurrent(parent);
}
else if(c.getLabel() == "Delete")
{
DeleteFriendForm dff
= new DeleteFriendForm(display,parent,_id,_name,_phone);
display.setCurrent(dff);
}
else
{
ModifyFriendForm mff
= new ModifyFriendForm(display,parent,_id,_name,_phone);
display.setCurrent(mff);
}
}
}
这是我做的毕业设计,我是学的自动化,却毕业设计做JAVA的 ,比较郁闷
请修改的详细点,或者哪位有电话簿的程序,请贴出来,小弟多谢了,解决问题即给分!
import javax.microedition.lcdui.*;
public class DetailInfo extends Form implements CommandListener
{
private Display display;
private Displayable parent;
private Command backCommand
= new Command("BACK",Command.BACK,1);
private Command deleteCommand
= new Command("Delete",Command.SCREEN,2);
private Command modifyCommand
= new Command("Modify",Command.SCREEN,2);
private StringItem idItem,nameItem,phoneItem;
private PhoneBook pb;
private String stringID;
private int id;
private Friend friend;
private int _id;
private String _name,_phone;
public DetailInfo(Display d,Displayable p,String idAndName)
{
super("Detail Info");
display = d;
parent = p;
addCommand(backCommand);
addCommand(deleteCommand);
addCommand(modifyCommand);
setCommandListener(this);
pb = new PhoneBook();
//get id from idAndName
stringID = idAndName.substring(0,2);
id = Integer.parseInt(stringID);
friend = pb.getFriend(id);
_id = friend.getID();
_name = friend.getName();
_phone = friend.getPhone();
idItem = new StringItem("ID:",_id + "");
nameItem = new StringItem("Name:",_name);
phoneItem = new StringItem("phone:",_phone);
append(idItem);
append(nameItem);
append(phoneItem);
}
public void commandAction(Command c,Displayable s)
{
if(c.getLabel() =="BACK")
{
display.setCurrent(parent);
}
else if(c.getLabel() == "Delete")
{
DeleteFriendForm dff
= new DeleteFriendForm(display,parent,_id,_name,_phone);
display.setCurrent(dff);
}
else
{
ModifyFriendForm mff
= new ModifyFriendForm(display,parent,_id,_name,_phone);
display.setCurrent(mff);
}
}
}
...全文
相关推荐
java获取某路径下文件名、大小、修改时间、类型
获取某路径下文件名、大小、修改时间、类型, 然后自己创建个实体类,在打印位置将文件属性set到实体类的相对应属性。原谅小弟收积分。我也是想赚点积分学习而已。提倡大家免积分分享。走向真正的开源。。。。
小弟用过的一些api
在给定的标题“小弟用过的一些api”和描述“小弟用过的一些api android api POI API”中,我们可以看出讨论的是关于Android API和Apache POI API的使用经验。
java纯文本数据库
一个Java纯文本数据库模型系统,正在开发中,有兴趣的话希望大家能帮助小弟改进。
java编程那些事儿
学习JAVA基础看他 很不错 相信你会喜欢的 这个是小弟自己做的 不好的地方请多多包含
java 初学笔记
作为0 基础的我在学习过程中所做的课堂笔记,希望能将java学好。希望大家多多教教小弟。


J2ME
