Java multi person interactive chat room based on TCP / IP connection
This example shares the specific code of java socket programming to realize multi person interactive chat room for your reference. The specific contents are as follows
This project consists of three parts Java files (client.java, server.java, UI. Java) and a. JPG picture file. Ui.java is the constituent file responsible for the interface. The interface of this chat room is extremely simple. It is mainly divided into two interfaces: the first is the interface that needs to log in during startup, as follows:
After entering the name, you can chat directly
This chat room is equivalent to group chat. Everyone who logs in will receive the message sent by others. Use guide:
1. Run server Java file to ensure the opening of the server 2 Run UI Java file, interface login. Each time you run a UI file and log in, you enter the group chat on behalf of a customer and can have a conversation.
The program is simple and easy to understand. It is very suitable for beginners to practice network programming.
Client. java
Server. java
UI. java
The above is the whole content of this article. I hope it will be helpful to your study, and I hope you can support programming tips.