Skip to content

JLiveChats is a Java-based real-time chating application that uses sockets to stream and visualize live data dynamically. Built with AWT/Swing for the UI and Java Sockets for network communication.

Notifications You must be signed in to change notification settings

bhola-dev58/JLiveChats

Repository files navigation

Real-time-Chating-Box-Using-Java-Sockets

This is a simple real-time chat application built using Java with a server-client architecture. The project consists of two parts:

  • Server Side: Handles incoming client connections and exchanges messages.
  • Client Side: Connects to the server and participates in the chat.

Features

  • Real-time messaging between server and client.
  • Simple GUI using Java's Swing framework.
  • Message handling and display in both the client and server.
  • Chat termination when either side sends the "exit" command.

Prerequisites

  • Java JDK 8 or later.
  • IntelliJ IDEA (or any other Java IDE).
  • Basic knowledge of networking in Java.

Project Structure

  • src/: Contains the source code for the server and client applications.
    • Server.java: Code for the server-side application.
    • Client.java: Code for the client-side application.

Setup Instructions

1. Clone the Repository

git clone https://github.com/bhola-dev58/JLiveCharts.git cd JLiveCharts

2. Open the Project in IntelliJ IDEA

  • Open IntelliJ IDEA.
  • Click on File > Open and select the folder where you cloned the project.

3. Run the Server

  • Open Server.java in the editor.
  • Run the Server class by clicking on the green play button or pressing Shift + F10.
  • The server will be waiting for client connections.

4. Run the Client

  • Open Client.java in the editor.
  • Modify the IP address in the code to your server's IP (e.g., "localhost" or your network IP).
  • Run the Client class similarly by clicking the play button or pressing Shift + F10.

5. Chatting

  • Once the client connects to the server, you can start typing messages in the text box.
  • Press Enter to send messages.
  • Type "exit" to terminate the chat from either side, both from the GUI and from the terminal/bash.

Exiting from Bash

  • If running the chat from the terminal, simply type "exit" and press Enter to close the connection and exit the chat.

Screenshots

Possible Issues

  • Port Already in Use: Ensure the port 8080 is free by checking if any other service is using it.
  • Firewall Blocking Connection: Allow Java through your firewall or disable the firewall temporarily.

Customization

  • You can change the port by modifying the ServerSocket initialization in the Server.java file.
  • To connect multiple clients, consider implementing multi-threading on the server-side.

About

JLiveChats is a Java-based real-time chating application that uses sockets to stream and visualize live data dynamically. Built with AWT/Swing for the UI and Java Sockets for network communication.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages