java聊天工具源代码.doc

合集下载
  1. 1、下载文档前请自行甄别文档内容的完整性,平台不提供额外的编辑、内容补充、找答案等附加服务。
  2. 2、"仅部分预览"的文档,不可在线预览部分如存在完整性等问题,可反馈申请退款(可完整预览的文档不适用该条件!)。
  3. 3、如文档侵犯您的权益,请联系客服反馈,我们会尽快为您处理(人工客服工作时间:9:00-18:30)。

v1.0可编辑可修改

源代码

项目 QQClientProject:

LoguiGui 代码 :

package class LoguiGui extends {

public LoguiGui() {

initComponents();

}

public Socket connectServer() {

Socket s = null;

try {

s = new Socket("", 6666);

} catch (Exception e)

{ ();

}

return s;

}

private void jButton1ActionPerformed evt) {

quals(name)) {

(this, "用户名不能为空, 请输入 ", "异常提示", ;

return;

}

String pwd = new String());

"密码: " + pwd);

if () == 0) {

v1.0可编辑可修改

(this, "密码不能为空,请输入", "异常提示", ;

return;

}

final Socket s = ();

endMsg(msg, s);

eceiveMsg(s);

etVisible(true);

}

});

();

} else {

(this, "登录失败:" + r, "异常提示", ;

}

private void jLabel3MouseClicked evt) {

etVisible(true);

}

});

}

RegiterGui代码:

package class RegiterGui extends {

private static final String url = "jdbc:odbc:mydata";

private static final String user = "mzz";

v1.0可编辑可修改private static final String pwd = "mzz";

public Socket connectServer() {

Socket s = null;

try {

s = new Socket("", 6666);

} catch (Exception e)

{ ();

}

return s;

}

private void jButton1ActionPerformed evt)

{ quals(name)) {

(this, " 用户名不能为空 , 请输入 ", " 异常提示 ", ;

return;

}

if == 0) {

(this, " 密码不能为空 , 请输入 ", " 异常提示 ", ;

return;

}

if == 0) {

(this, " 密码不能为空 , 请确认 ", " 异常提示 ", ;

return;

}

if (!(pwd0, pwd2)) {

(this, " 密码输入错误 , 请重新输入 ", " 异常提示 ", ;

return;

v1.0可编辑可修改}

String sex = null;

if ()) {

sex = ();

"性别: " +

sex); } else if ())

{ sex = ();

"性别: " +

sex); } else if ())

{ sex = ();

"性别: " + sex);

}

String hobby =null;

if ()) {

hobby = ();

"爱好: " +

hobby); } else if ())

{ hobby = ();

"爱好: " +

hobby); } else if ())

{ hobby =();

"爱好: " + hobby);

}

String birth = () + "年" + "" + () + "月";

" 生日: " + birth);

String city = (String) ());

"城市 :" + city); String

profession = ();

"职业 :" + profession);

Socket s = ();

endMsg(msg, s);

eceiveMsg(s);

tart();

}

public JList getUsersListItem() {

return usersListItem;

}

public void setUsersChatItem(String usersChat) { String s= void addUsers(List list) { DefaultListModel dlm = (DefaultListModel) ();

for (User u : list) {

(u);

}

}

public void addNewUser(User u) { DefaultListModel dlm = (DefaultListModel) (); (u);

}

public void delUser(User curu) {

相关文档
最新文档