├── .gitignore
├── README.md
├── Users.properties
├── screenshot
├── 1.png
├── 2.png
├── 3.png
├── 4.png
└── 5.png
└── src
├── client
└── ChatRoom.java
├── function
├── Bean.java
└── ClientBean.java
├── login
├── Login.java
├── Login2.java
└── Resign.java
├── server
├── Message.java
└── Server.java
└── util
└── Util.java
/.gitignore:
--------------------------------------------------------------------------------
1 | ######################################################################
2 | # Build Tools
3 |
4 | .gradle
5 | /build/
6 | !gradle/wrapper/gradle-wrapper.jar
7 |
8 | target/
9 | !.mvn/wrapper/maven-wrapper.jar
10 |
11 | out/
12 |
13 | ######################################################################
14 | # IDE
15 |
16 | ### STS ###
17 | .apt_generated
18 | .classpath
19 | .factorypath
20 | .project
21 | .settings
22 | .springBeans
23 |
24 | ### IntelliJ IDEA ###
25 | .idea
26 | *.iws
27 | *.iml
28 | *.ipr
29 |
30 | ### NetBeans ###
31 | nbproject/private/
32 | build/*
33 | nbbuild/
34 | dist/
35 | nbdist/
36 | .nb-gradle/
37 |
38 | ######################################################################
39 | # Others
40 | *.log
41 | *.xml.versionsBackup
42 | *.swp
43 |
44 | !*/build/*.java
45 | !*/build/*.html
46 | !*/build/*.xml
47 |
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 |
28.基于java的聊天室
2 |
3 | - 完整代码获取地址:从戎源码网 ([https://armycodes.com/](https://armycodes.com/))
4 | - 技术探讨、资料分享,请加QQ群:692619798
5 | - 作者微信:19941326836 QQ:952045282
6 | - 承接计算机毕业设计、Java毕业设计、Python毕业设计、深度学习、机器学习
7 | - 选题+开题报告+任务书+程序定制+安装调试+论文+答辩ppt 一条龙服务
8 | - 所有选题地址 ([https://github.com/YuLin-Coder/AllProjectCatalog](https://github.com/YuLin-Coder/AllProjectCatalog))
9 |
10 | ## 项目介绍
11 |
12 | 基于java的聊天室:简单的聊天室学习案例,模拟服务端和两个客户端,客户端A和客户端B可以互相收发消息,服务端有广播和强制下线功能
13 |
14 | ## 环境
15 |
16 | - IntelliJ IDEA 2009.3
17 |
18 | - JDK 1.8
19 |
20 | ## 运行截图
21 | 
22 |
23 | 
24 |
25 | 
26 |
27 | 
28 |
29 | 
30 |
31 |
32 |
33 |
--------------------------------------------------------------------------------
/Users.properties:
--------------------------------------------------------------------------------
1 | #Copyright (c) Boxcode Studio
2 | #Sun Dec 04 22:30:13 CST 2022
3 | 12345=123456
4 | AAA=123
5 | qwert=1234
6 | CCC=123
7 | qwer=1234
8 | BBB=123
9 |
--------------------------------------------------------------------------------
/screenshot/1.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/YuLin-Coder/No28JavaChatRoom/2dd42b41df1c8b1be5e990aac67c57328a4c9f89/screenshot/1.png
--------------------------------------------------------------------------------
/screenshot/2.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/YuLin-Coder/No28JavaChatRoom/2dd42b41df1c8b1be5e990aac67c57328a4c9f89/screenshot/2.png
--------------------------------------------------------------------------------
/screenshot/3.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/YuLin-Coder/No28JavaChatRoom/2dd42b41df1c8b1be5e990aac67c57328a4c9f89/screenshot/3.png
--------------------------------------------------------------------------------
/screenshot/4.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/YuLin-Coder/No28JavaChatRoom/2dd42b41df1c8b1be5e990aac67c57328a4c9f89/screenshot/4.png
--------------------------------------------------------------------------------
/screenshot/5.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/YuLin-Coder/No28JavaChatRoom/2dd42b41df1c8b1be5e990aac67c57328a4c9f89/screenshot/5.png
--------------------------------------------------------------------------------
/src/client/ChatRoom.java:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/YuLin-Coder/No28JavaChatRoom/2dd42b41df1c8b1be5e990aac67c57328a4c9f89/src/client/ChatRoom.java
--------------------------------------------------------------------------------
/src/function/Bean.java:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/YuLin-Coder/No28JavaChatRoom/2dd42b41df1c8b1be5e990aac67c57328a4c9f89/src/function/Bean.java
--------------------------------------------------------------------------------
/src/function/ClientBean.java:
--------------------------------------------------------------------------------
1 | package function;
2 |
3 | import java.net.Socket;
4 |
5 | public class ClientBean {
6 | private String name;
7 | private Socket socket;
8 |
9 | public String getName() {
10 | return name;
11 | }
12 |
13 | public void setName(String name) {
14 | this.name = name;
15 | }
16 |
17 | public Socket getSocket() {
18 | return socket;
19 | }
20 |
21 | public void setSocket(Socket socket) {
22 | this.socket = socket;
23 | }
24 | }
25 |
--------------------------------------------------------------------------------
/src/login/Login.java:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/YuLin-Coder/No28JavaChatRoom/2dd42b41df1c8b1be5e990aac67c57328a4c9f89/src/login/Login.java
--------------------------------------------------------------------------------
/src/login/Login2.java:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/YuLin-Coder/No28JavaChatRoom/2dd42b41df1c8b1be5e990aac67c57328a4c9f89/src/login/Login2.java
--------------------------------------------------------------------------------
/src/login/Resign.java:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/YuLin-Coder/No28JavaChatRoom/2dd42b41df1c8b1be5e990aac67c57328a4c9f89/src/login/Resign.java
--------------------------------------------------------------------------------
/src/server/Message.java:
--------------------------------------------------------------------------------
1 | package server;
2 |
3 | public class Message {
4 | public static String LoginMsg = "LOGIN";
5 | public static String LogoutMsg = "LOGOUT";
6 | public static String UserListMsg = "USERLIST";
7 | public static String UserExsistMsg = "USEREXSIST";
8 | public static String PrivateMsg = "PRIMSG";
9 | public static String NewGrChatMsg = "NEWGRCHAT";
10 | public static String GroupExsistMsg = "GROUPEXSIST";
11 | public static String GroupMsg = "GROMSG";
12 | public static String UpdateGrLMsg = "UPDATEGL";
13 | public static String ExitGroupChatMsg = "EXITGC";
14 | public static String BroadcastMsg = "BRDCASTMSG";
15 | public static String ChatroomMsg = "CHATRMSG";
16 | public static String PastMsg = "PASTMSG";
17 | }
18 |
--------------------------------------------------------------------------------
/src/server/Server.java:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/YuLin-Coder/No28JavaChatRoom/2dd42b41df1c8b1be5e990aac67c57328a4c9f89/src/server/Server.java
--------------------------------------------------------------------------------
/src/util/Util.java:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/YuLin-Coder/No28JavaChatRoom/2dd42b41df1c8b1be5e990aac67c57328a4c9f89/src/util/Util.java
--------------------------------------------------------------------------------