Chat Room Application
Click to Download the Application
In this application we have four java classes as following:
- java : running backward as a server site, so it is don’t have user interfaces. When we run the application it uses 2222 port number to send a messages.
- java: this class has GUI for chatting
- java: this class responsible to make Synchronization between clients in chat room, in this class we defined an object array of clientThread to store client connections, we suppose the Max Client Number is 10 connections, so when the connection arrived to 10 connections the server refuse the new connection.
- java: this class used as object when any client want to join to chat room the MultiThreadChatServer class create new object from this class for the new connection.
Implementation:
When running the application show message with two choices server or client in the beginning we run the application as a server
And the second running as a client
when running the application as a client show the message to input the server ip address for our example we running it at the same computer, so we input localhost, but if the server in another computer we will enter the ip address for that computer which running as a server
the screen below show the chat window. at the first time you must enter your name to join to chat room after that you can send message to the people who joining in chat room
After entering your name it show you greeting message.
When another user joining in chat room show the message for all current users tell them new user joining with you in chat room
the screen below showing that user-2 joining in chat room.
When a user write a message in chat, his name showing between < > and the message
The screen below show when a user leaving the chat room, it send for all user <user name> leaving the chat room.
