A simple client-server instant messaging application built in Java using Sockets and Swing GUI. This project demonstrates how two computers (or two programs on one machine) can communicate in real time over a network using TCP sockets.
- Java SE
- Java Sockets (ServerSocket, Socket)
- Swing GUI (JFrame, JTextArea, JTextField)
- Object Streams (ObjectInputStream, ObjectOutputStream)
| File | Description |
|---|---|
| Server.java | Handles server-side messaging, GUI, and socket communication |
| ServerTest.java | Starts the server GUI and listens for connections |
| Client.java | GUI client that connects to the server and enables chat |
| ClientTest.java | Launches the client app and connects to server at 127.0.0.1 |
Note: You can run both the server and client on the same machine using localhost (127.0.0.1), or across two different computers on the same network by replacing 127.0.0.1 with the server's IP.
- Open a terminal or IDE in the project folder.
- Compile all files: On bash:
javac *.java