If you are going to use only Core Java, here are my options:
Your program must have a server thread. It should listen for incoming requests on a specific port. Each time a request arrives, it must spawn a new thread. The new thread should create a GUI for communication. Keep in mind that the server must pass the Socket instance for the newly created thread for further communication.
Using a socket instance, you can communicate with a remote client.
Use Swing for a graphical interface.
The graphical user interface should allow users to connect to any IP address. When a user connects to any IP address, he must do this on the port where your server stream is listening.
I assume that you are familiar with the basics of multithreading, network programming and swing.
source share