

Also, in the Arraylist, I keep the XOffset and YOffSet position of each message. Whenever users enter the message, I will store it in arraylist. The basic idea of creating a message canvas is based on simple logic.I have created my OWN Custom Components like Tab Control and Image Supported Message Canvas. Another important thing in the client module is the USER INTERFACE.

Once it gets connected, the chat client will keep the socket connection and communicate with the server whenever the user commands it. When the Chat Client runs, it will open a socket and connect to ChatServer by sending HELO RFC to Server.I will also briefly explains the concepts behind the Client side Chat. In ChatCommunication class, we will create a thread to watch all the commands from the client and responds to the client too.ĬhatCommunication chat = new ChatCommunication(socket) ĭout = new Dataoutputstream(personalsocket.getoutoutstream()) This is a sample code of getting connection from the Chat Client and creating a new object of ChatCommunication. If you take a look ChatCommunication.java, you will get all the details. So, when the client sends QUIT command, it will close the thread too. If the client connects to the server, it will open a separate thread to service. When the Chat Server runs, it opens the Server Socket at port 1436 (we can modify too) and listen for the client to connect.Created custom UserObject class which will have the client details like username, the socket of user, and the room name, etc.I will briefly explain the concepts behind the server side. CALL - Request for voice chat (not included with this one).ROCO - Get users count in specified room.Some of the commands which I have used in this application are listed below: In server side, I have defined our own RFC Commands. In this Chat application, we have both server side and client side modules. Great Look and Feel with Customized Color.Of putting the source code as per the request of The Code Project members. Now I have posted all the concepts behind the chat instead Also, I have uploaded the complete source code here. For this application, I have developed my own Tab Control and Image Canvas. This Java Chat is purely AWT based, no Swing Components used and still it has a great look and feel. I have already posted Tap Control in Java here.

This is my second article on The Code Project. Note: The latest source code has been uploaded along with this article now.
