Java Chat Application

A small chat room like application made in 2 hours.

sample image

Here is the link to the source codes on github

Short Description

The small app is implemented into two different java codes (Server-Client).

Server:

The server code initializes the server to be used by a client or more than one client.
My code uses the number (4000) as a socket for the clients. Note: It can be replaced by any number of your choice. Then it accepts the data sent by any client, then sends these data to all the clients.

Client:

The client code creates a client with a basic gui that connects to the (4000) socket. The client provides an area to read the chat, an area where you could write your message to be sent, an area to write your user name and a button to send your message. To create multiple clients run the code multiple times. Note: you can send also using “Enter” key, also while writing a “someone is writing” message appears to indicate that someone is writing.

Multiple PCs:

If you want to use these codes on multiple PCs just run the server on one PC then run the client on another PC (connected on the same network) and replace the IP “127.0.0.1” with the IP from the server PC found in windows network properties, as the IP “127.0.0.1” indicates that the server is on the same PC as the client.

If this link helped you do something.

Design a site like this with WordPress.com
Get started