Вы находитесь на странице: 1из 21

Made By Hemant Sharma Btech IT

What is JAVA?
Java programming language (a highlevel, object-oriented programming language) Java Virtual Machine (a highperformance virtual machine that executes byte codes on a specific computing platform, typically JVM

Uses of JAVA
Java allows you to play online games, chat with people around the world, calculate your mortgage interest, and view images in 3D, just to name a few. It's also integral to the intranet applications and other e-business solutions that are the foundation of corporate computing.

Features of JAVA
Simple Security Portability Object oriented Multithreaded Dynamic Distributed

Lets talk about project?

This particular project is a solution developed to communicate between the users .

The concept of sending messages and letters has been reduced due to the new era of Internet Mailing. One such facility is being provided by the Chat Server

Chat

Chat is roughly described as a connection-oriented service, because a user establishes a connection and maintains that connection, sending and receiving text for the duration of the session.

Introduction of chat server


Chat server is a stand-alone application that is made up the combination of two-application, server application (which runs on server side) client application (which runs on client side). This application is using for chatting in LAN. To start chatting you must be connected with the server , after that your message can broadcast to each and every client.

Existing System: It is limited to only two clients. The existing Chat Server System is only meant for transfer of messages from one client to the other. But the messages cannot be formatted and made attractive to look as well as graphical emotional pictures cannot be added to send the picture messages.

Proposed System

The proposed Chat Server is a chatting application that provides a good user interface with all the facilities of a chat application. Users have their user-id or Login name. User can communicate with any other user, who is online. User gets a list of online users. User can select any user and send a message.

Here it is shown the chatserver login window.


Some features of the application are as follows : It is used for sending messages from one client to all clients. In this, server takes a message from the sender client and sends it to all clients. If any client wants to join the chatting then he runs the client application on client side, enters the login name and hits the login button and starts the chatting with every client.

Chat-Server is comprising of two applications:Server side application Client side application

What does the server and client do? Our server will be a stand-alone program -- a single Java process running on its own machine. It won't require any support software other than a Java virtual machine.

Server side application

This application is used for receiving the messag es from any client and send to each and every cli ent and in this we can maintain the list of all online users.
*

This application is unable to provide the private chatting facility


*

The Server side application follows these steps

Firstly creates a new server socket by the ServerSocket ss = new ServerSocket(1004);

After creating the ServerSocket it accepts the client socket and add this socket into arraylist.

After getting the client socket it creates a thread and make DataInputStream for this socket. After creating the input stream its read the user name and add it to arraylist and this arraylist object write in ObjectOutputStream of each client .

Client side application


For

creating the Client side application

Firstly creates the login frame it consist one text field and the login button.

After hitting the login button it shows the next frame that Client Frame and it consist one text field for writing the message and one send button for sending it. And two list boxes, one is for showing the all messages and another list box is use to show the all user names. This frame has one more button that is Logout button for terminating the chat

The Client side application follows these steps :

In the client sides firstly creates a new socket and specifies the address and port of the server and establish the connection with the Server. Socket s=new Socket("localhost",1004);

After that client makes a new thread and DataInputStream, ObjectInputStream and DataOutputStream for sending the user name and retrieving the list of all users and add the all user name in its list box through iterator. Now we make one new thread for sending and receiving the messages from the server. It does this task by using DataInputStream and DataOutputStream. When the client is logged out it sends its name and message UserName has Logged out and terminate the chatting

Limitations of the application:

This application is used for sending and receiving the messages but the message is shown to every client. Means this application is unable to provide the private chat facility it is like a multi party conference. Before running the client application make sure the server application is running. If server is not in running condition then you can not start the chatting.

Вам также может понравиться