云题海 - 专业文章范例文档资料分享平台

当前位置:首页 > 《计算机网络通信》课程设计报告

《计算机网络通信》课程设计报告

  • 62 次阅读
  • 3 次下载
  • 2025/6/17 17:10:54

附 录

}

public void sendToAll(String msg) {

int count=userInfoList.getCount(); int i=0; while(i

Node node=userInfoList.find(i); if(node==null) { } try { }

catch(Exception e) { } i++;

- 26 -

node.output.writeObject(\聊天信息\node.output.flush();

node.output.writeObject(msg); node.output.flush(); i++; continue;

}

}

catch(Exception e) { }

}

break;

附 录

} {

String userlist=\

int count=userInfoList.getCount(); int i =0; while(i

while(i

Node node =userInfoList.find(i); if(node==null) { } try {

node.output.writeObject(\用户列表\node.output.flush();

node.output.writeObject(userlist);

- 27 -

i++; continue;

Node node=userInfoList.find(i); if (node==null) { }

userlist+=node.username; userlist+='\\n'; i++;

i++; continue;

public void sendUserList()

}

附 录

} } }

//客户端主框架类 import java.awt.*; import java.awt.event.*; import javax.swing.*; import javax.swing.event.*; import javax.swing.border.*;

import java.io.*; import java.net.*;

public class ClientFrame extends JFrame { private JComboBox combobox; private JTextArea textarea; private JTextField textfield; private JCheckBox checkbox; private JComboBox actionlist; private JButton login; private JButton logout; private Border border; private JTextField seperater; private JScrollPane js;

private JButton b1; }

catch(Exception e) { } i++;

node.output.flush();

Socket socket;

ObjectOutputStream output; ObjectInputStream input;

ClientReceiveThread recvThread;

- 28 -

附 录

public ClientFrame() {

super(\客户端\

Border bevelBorder=BorderFactory.createBevelBorder(BevelBorder.RAISED,

Color.white,Color.white,Color.white,Color.white);

Border emptyBorder=BorderFactory.createEmptyBorder(1,1,1,1); border=BorderFactory.createCompoundBorder(bevelBorder,emptyBorder);

login=new JButton(\上线\logout=new JButton(\下线\b1=new JButton(\发送\logout.setEnabled(false); combobox=new JComboBox(); combobox.addItem(\所有人\combobox.setSelectedIndex(0);

textarea=new JTextArea(20,20); textarea.setEditable(false); js=new JScrollPane(textarea);

textfield=new JTextField(\请先输入你的昵称,再上线\

seperater= new JTextField(\seperater.setEditable(false);

checkbox=new JCheckBox(\悄悄话\checkbox.setSelected(false); actionlist=new JComboBox(); actionlist.addItem(\微笑地\actionlist.addItem(\生气地\actionlist.addItem(\小心地\actionlist.setSelectedIndex(0);

- 29 -

搜索更多关于: 《计算机网络通信》课程设计报告 的文档
  • 收藏
  • 违规举报
  • 版权认领
下载文档10.00 元 加入VIP免费下载
推荐下载
本文作者:...

共分享92篇相关文档

文档简介:

附 录 } public void sendToAll(String msg) { int count=userInfoList.getCount(); int i=0; while(i

× 游客快捷下载通道(下载后可以自由复制和排版)
单篇付费下载
限时特价:10 元/份 原价:20元
VIP包月下载
特价:29 元/月 原价:99元
低至 0.3 元/份 每月下载150
全站内容免费自由复制
VIP包月下载
特价:29 元/月 原价:99元
低至 0.3 元/份 每月下载150
全站内容免费自由复制
注:下载文档有可能“只有目录或者内容不全”等情况,请下载之前注意辨别,如果您已付费且无法下载或内容有问题,请联系我们协助你处理。
微信:fanwen365 QQ:370150219
Copyright © 云题海 All Rights Reserved. 苏ICP备16052595号-3 网站地图 客服QQ:370150219 邮箱:370150219@qq.com