java个人通讯录源代码 java通讯录系统代码( 四 )


String getMsn() {
return msn;
}
void setMsn(String msn) {
this.msn = msn;
}
String getName() {
return name;
}
void setName(String name) {
this.name = name;
}
String getNotes() {
return notes;
}
void setNotes(String notes) {
this.notes = notes;
}
String getOfficeAddress() {
return officeAddress;
}
void setOfficeAddress(String officeAddress) {
this.officeAddress = officeAddress;
}
Integer getOfficePhone() {
return officePhone;
}
void setOfficePhone(Integer officePhone) {
this.officePhone = officePhone;
}
Integer getPersonalMobilePhone() {
return personalMobilePhone;
}
void setPersonalMobilePhone(Integer personalMobilePhone) {
this.personalMobilePhone = personalMobilePhone;
}
Integer getQqNumber() {
return qqNumber;
}
void setQqNumber(Integer qqNumber) {
this.qqNumber = qqNumber;
}
public TelBook() {
}
public TelBook(String name, Integer personalMobilePhone) {
this.setName(name);
this.setPersonalMobilePhone(personalMobilePhone);
}
/**
* @param args
*/
public static void main(String[] args) {
// TODO Auto-generated method stub
TelBook myfriend = new TelBook("张三", new Integer("13800138000"));
}
}
用JAVA写一个通讯录,怎么写 。源代码 。采用C/S的架构方式 。
首先用swing 画几个条条框框出来 。做出显示 和 添加 修改的界面 。
添加的时候 。吧输入的信息存入数据库
修改的时候 修改数据库里面的内容
查询的时候 显示数据库里面的内容 。
不想用数据库 也可以吧文件写在磁盘上 。不过这样,还不如用个excel当通讯录用来的省事 。
这就是high level 。detail么 自己研究吧
java通讯录全部代码!import java.io.BufferedOutputStream;
import java.io.File;
import java.io.FileNotFoundException;
import java.io.FileOutputStream;
import java.io.FileReader;
import java.io.IOException;
import java.io.PrintWriter;
import java.util.Scanner;
public class AddList {
private String filePath = "";
private String bakPath = "";
private String content = "";
Scanner sc = new Scanner(System.in);
public String readFile(){
content = "";
if (isNull(filePath)) {
System.out.println("文件存储路径java个人通讯录源代码:");
filePath = sc.nextLine();
}
File file = new File(filePath);
FileReader fr = null;
try {
if (file.exists()) {
fr = new FileReader(file);
char[] chars = new char[1024];
int n = 0;
while((n = fr.read(chars)) != -1){
String string = new String(chars, 0, n);
content = content + string;
}
} else {
System.out.println("文件不存在");
}
} catch (Exception e) {
e.printStackTrace();
} finally {
if (fr != null) {
try {
fr.close();
} catch (IOException e) {
e.printStackTrace();
}
}
}
return content;
}
public void writeFile(String path){
File file = new File(path);
FileOutputStream fos = null;
mkDirs(path);
try {
fos = new FileOutputStream(file);
BufferedOutputStream bos = new BufferedOutputStream(fos);
PrintWriter pw = new PrintWriter(bos, true);
pw.print(content);
pw.flush();
} catch (FileNotFoundException e) {
e.printStackTrace();
} finally {
if (fos != null) {
try {
fos.close();
} catch (IOException e) {
e.printStackTrace();
}
}
}
}
public void writeFile(){
if (isNull(filePath)) {

推荐阅读