Click here to Skip to main content
Licence CPOL
First Posted 20 Oct 2011
Views 1,721
Downloads 7
Bookmarked 0 times

Server Client Chat application in java using sockets and swing

By | 20 Oct 2011 | Video
Server Client Chat application in java using sockets and swing
 

Introduction

 This is a basic java chat application for chatting on LAN. I am still a beginner in java, so I would like to improvise on the way I do my coding. That is the main reason for posting this article, as I hope the people in this community would suggest me better ways to implement the ideas.

Background

  I have used swing and threads in this app. I have heard that it is not a good practice to use these two things together, so some suggestions would be great.

Using the code

  The MyServer.java file is executed on the server side, in our case, we will do both the server and client parts on the same machine. While the server program is running, Login.java is run, which asks for the login name. After login a console is opened up which gives a list of online users. Any number of users can login by executing the Login.java

MyClient.java is the file which is

Blocks of code should be set as style "Formatted" like this:

			//
			// Any source code blocks look like this
			//
		

Remember to set the Language of your code snippet using the Language dropdown.

Use the "var" button to to wrap Variable or class names in <code> tags like this.

Points of Interest

Did you learn anything interesting/fun/annoying while writing the code? Did you do anything particularly clever or wild or zany?

History

Keep a running update of any changes or improvements you've made here.

License

This article, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

About the Author

VigneshPT



United States United States

Member



Comments and Discussions

 
You must Sign In to use this message board. (secure sign-in)
 
Search this forum  
 FAQ
    Noise  Layout  Per page   
  Refresh
-- There are no messages in this forum --
Permalink | Advertise | Privacy | Mobile
Web01 | 2.5.120517.1 | Last Updated 20 Oct 2011
Article Copyright 2011 by VigneshPT
Everything else Copyright © CodeProject, 1999-2012
Terms of Use
Layout: fixed | fluid