chatMessenger
Welcome Everyone!!
I have created a simple 💬 Chat Messenger using networking libraries of Java. For the front end I have used JFrame class of Swing.
Usage
ClientTest.java
.
1. Set the host IP in I have set it to local host, you can set it to the Host's public IP if you want.
import javax.swing.JFrame;
public class ClientTest {
public static void main(String args[]){
Client cl=new Client("127.0.0.1");
cl.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
cl.startRunning();
}
}
TestServer.java
and ClientTest.java
by javac
compiler.
2. Compile the On Server Machine:
javac TestServer.java
On Client Machine:
javac ClientTest.java
TestServer.class
and ClientTest.class
files.
3. Run the compiled On Server Machine:
java TestServer
You will have server window opened which starts listening for connections on port 1234.
On Client Machine:
java ClientTest
Connection will be established if no error is thrown and client window will popup. Communication can be done now!