Popular Posts

Monday, February 13, 2012

Simple Chatting Program in Java

   This article explain how to write simple chatting GUI program in java using Socket. I use MigLayout for Layout Manager. It is a simple third party java layout , you can download it from miglayout-3.7-swing.jar or It is available with my project Files.

System Setup:
   Install JDK 1.4 or above JDK versions in your Windows or Linux Systems.
   

Running APPS:
Runnig Server  side System:
  Download  Server files for server side communication.

  In Windows:

  • Open command prompt.
  • Goes to the directory (folder) where you save the project and type the below commands.
  • javac -cp ;miglayout-3.7-swing.jar ServerGUI.java 
       for comipling the project.
  • java -cp ;miglayout-3.7-swing.jar ServerGUI for Running project.


In Linux:
  • Open terminal window.
  • Goes to the directory (folder) where you save the project and type the below commands.
  • export CLASSPATH =${CLASSPATH}:(path of the jar file with .jar extension).
  • javac  ServerGUI.java   for compilation.
  • java  ServerGUI   for Runing the project.


 It asks  your name, After enter  your name ,System waiting for client request, If any request received from client, The server accept and shows the frame for communication.


Runnig Client side System:
      Download  Client  files for server side communication. 

   Make sure you run Server App in one system in the Network before run Client App.
Commands:
  In Windows:
  • Open command prompt.
  • Goes to the directory (folder) where you save the project and type the below commands.
  • javac -cp ;miglayout-3.7-swing.jar ClientGUI.java   for compilation.
  •  java -cp ;miglayout-3.7-swing.jar ClientGUI   for Runing the project.



In Linux:
  • Open terminal window.
  • Goes to the directory (folder) where you save the project and type the below commands.
  • export CLASSPATH =${CLASSPATH}:(path of the jar file with .jar extension).
  • javac  ClientGUI.java   for compilation.
  • java  ClientGUI  for Runing the project.

    It asks the server IP address and your name, After enter  IP address and your name the frame appear on the screen, Now you are ready to chat.

Testing in a Single System in Network:
   It is also possible to test the Server and Client Apps in the same System using the above procedures,
If you connected in an Network.

Testing in a Single System with out  Network Connection:
 Normally there is a IP Address 127.0.0.1 for Loop back connection, use this IP address .




1 comment:

  1. If you're attempting to burn fat then you certainly have to jump on this totally brand new custom keto meal plan diet.

    To create this service, licenced nutritionists, fitness couches, and chefs united to develop keto meal plans that are powerful, decent, money-efficient, and delightful.

    Since their launch in early 2019, 1000's of individuals have already completely transformed their figure and well-being with the benefits a proper keto meal plan diet can give.

    Speaking of benefits: clicking this link, you'll discover eight scientifically-proven ones offered by the keto meal plan diet.

    ReplyDelete