Skip to content

A Client-Server chat application made in Java using Java Swing for front-end and Java Sockets for back-end

Notifications You must be signed in to change notification settings

ksedix/Java-Client-Server-Chat

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

26 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Java-Client-Server-Chat

A Client-Server chat application made in Java using Java Swing for front-end and Java Sockets for back-end

Preview

Client

The client is first presented with a login window. The login window has 2 fields - the username of the client and the server IP address that the client wishes to connect to. The default Server IP Address is localhost - the clients own computer.
client login

If the server is not running on the IP address specified by the client, the client will get an error message "Failed to connect to Server" when they click on the connect button.
Failed to connect to server

If the server is running on the IP address specified by the client, the client will be presented with a chat window, after they click on the connect button, where they can see all the users that are connected to the same server and can chat with them. The image below shows 2 different clients talking to each other. chat window

Server

The server is made up of a single window with 4 buttons:
Save Chat: Save the chat log to a text file
Load Chat: Load the chat from a text file
Shut Down: Shut down the server. All clients will be disconnected. (This function is not implemented yet)
Start Server: Starts the Server. The server needs to be started in order for clients to be able to connect to it.
Server window

When we start the server, it will tell us that the server is listening for connections on port 1234. Now, clients can connect to it if they specify the correct Server IP address.
Server running

How To Run

There are 2 ways to run the application:

  • Download Client.jar and Server.jar from the repository and run them.
  • Clone the entire project and run Client.java to start the Client and Server.java to start the Server.

About

A Client-Server chat application made in Java using Java Swing for front-end and Java Sockets for back-end

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages