1、 I 课程设计报告 课 程 名 称课 程 名 称 : Java 程序设计程序设计 课 程 代 码课 程 代 码 : 题题 目目 : 简单简单聊天室聊天室 年级年级/专业专业/班班 : 学 生 姓 名学 生 姓 名 : 学学 号号 : 指 导 老 师指 导 老 师 : 开 题 时 间开 题 时 间 : 完 成 时 间完 成 时 间 : I 目目 录录 摘 要 I 1 引言.1 2 设计任务与目的 .1 3 需求分析1 3.1 系统用例图 .1 3.2 主要用例分析 2 4 系统设计 3 4.1 总体设计 3 4.1.1 系统类图 3 4.1.2 主要时序图 .6 4.2 详细设计 8 4.2.1
2、 ChatServer 类 9 4.2.2 ServerListen 类 10 4.2.3 ServerReceive 类 10 4.2.4 PortConf 类 . 11 4.2.5 Help 类 . 11 4.2.6 UserLinkList 类 . 11 4.2.7 Node 类 12 4.2.8 ChatClient 类 . 13 4.2.9 ConnectConf 类 . 15 4.2.10 UserConf 类. 15 4.2.11 Help 类 16 4.2.12 ClientReceive 类 16 5 系统实现 16 5.1 系统主要用例的实现 16 5.1.1 聊天室服务端
3、用例运行效果 17 5.1.2 聊天室客户端用例运行效果 18 5.2 系统发布与运行 . 18 5.2.1 系统打包 18 5.2.2 系统发布与运行 18 6 结束语 . 19 参考文献 . 19 致谢 19 附录 A:系统源程序 . 20 1、ChatServer 类 . 20 2、ServerListen 类 . 31 3、ServerReceive 类 . 32 4、UserLinkList 类. 36 5、Node 类 39 II 6、PortConf 类 40 7、Help 类 42 8、ChatClient 类 44 9、ClientReceive 类 . 56 10、Conn
4、ectConf 类 . 58 11、UserConf 类 61 12、Help 类. 63 附录 B:编码规范 . 66 I 摘摘 要要 本课程设计我们通过聊天室的代码实现,体会到将理论知识与具体实现相结合,巩 固 Java 相关方法。聊天室共分为服务器端和客户端两部分,服务器端程序主要负责侦 听客户端发来的消息,客户端需登陆到服务器才可以实现正常的聊天功能。本聊天系统 以聊天交流为主,为广大用户提供一个借助网络进行人际交往的平台,也是网络与现实 最贴近的实用型网站。 关键词:关键词:(3-5 个,每个之间用分号隔开) 聊天室;多线程;C/S 模式 Abstract Abstract The
5、course design our chat room through the code, underThe course design our chat room through the code, understand the theoretical stand the theoretical knowledge and practical realization of the combination, the consolidation of knowledge and practical realization of the combination, the consolidation
6、 of javajava- -related methods. Chat client and the server is divided into two parts, related methods. Chat client and the server is divided into two parts, the client, serverthe client, server- -side program is mainly responsible for listening client sent side program is mainly responsible for listening client sent t the news to be landing the client to the server will be realized only if the he news to be landing the client to the server will be realized only if the normal chat. The