Vous êtes sur la page 1sur 40

REPORT

ON
“Browser”

Submitted to Uttaranchal University in partial fulfillment of the requirements for the degree of

BACHELOR OF COMPUTER APPLICATION


SESSION (2018-2019)

Under the guidance of: - Submitted by:-

Miss.LISA GOPAL ANSHUL

ANSHUMAN

BCA 5 SEM

Page 1
TABLE OF CONTENTS
S.No. Title Page no.
1. ACKNOWLEDGEMENT 3
2. DECLARATION 4
3. CERTIFICATE OF ORIGINALITY 5
4. INTRODUCTION 6
5. OBJECTIVES 7
6. SYSTEM ANALYSIS 8
7. DATA FLOW DIAGRAM 10
8. TECHNOLOGIES USED 11
9. MINIMUM REQUIREMENTS 11
10. CODING 12
11. OUTPUTS 38
12. FUTURE SCOPE 40
13. CONCLUSION 40
14. BIBLIOGRAPHY 41
15.
16.
17.

ACKNOWLEDGEMENT
We express our sincere gratitude to “Miss lisa gopal” for his constant support and

valuable suggestions without which the successful completion of this Dissertation

Page 2
would not have been possible. We express our immense pleasure and thankfulness

to all the teachers of the Uttaranchal University for their cooperation and support.

Finally, we are thankful to our classmates for their cooperation and support that

helped us in the successful completion of this work.

Project Members:- ANSHUL

ANSHUMAN

Page 3
DECLARATION
We hereby declare that the project report entitled “BROWSER” submitted
by Anshuman and Anshul to Uttaranchal institute of Management. The project
was done under the guidance of “Miss lisa gopal”. We further declare that the
work reported in this project has not been submitted and will not be
submitted, either in part or in full, for the award of any other degree or
diploma in this university or any other University or institute.

Signature of the Candidate 1

ANSHUL

Signature of the Candidate 2

ANSHUMAN

Page 4
CERTIFICATE OF ORIGINALITY
This is to certify that We are responsible for the work submitted in this paper, that
the original work is my own expect as specified in acknowledgements or in
footnotes, and that neither the paper nor the original work contained there has been
submitted to any journal or institution for publication.

Mentor: Project Members:

Miss.Lisa gopal Anshul

Anshuman

Page 5
INTORDUCTION

The growth of the Internet has led to new and faster forms of communication.
There are now programs that allow users to communicate in real-time with one or
more people. These instant messaging tools are commonly referred to as browse
the internet. Some of these programs can be downloaded for free.

Browser is one the same way can be used to talk to your friend in your circle .All
you have to do is to provide his IP address and then you both will get connect to
each other and then you can talk.It is helpful because if you have any problem
while solving something you do not have to go to his room and to meet him and
you can talk to him on chat if you both are connected to each other and can get
solution of your problem .browser application is one of the most useful software
which is used to surf the internet.

Page 6
OBJECTIVE

 To make internet process easy.


 To make internet reliable and secure.
 To design a user friendly application.
 To design a platform independent application.

Page 7
SYSTEM ANALYSIS

The application which we have implemented contain following things :-

1.1 SERVER

1.2 CLIENT

SERVER :
The server program plays a passive role: it constantly checks its network
connection to see if there are any clients sending it requests for a service it can
provide. Once the server program detects a service request, it establishes the socket
and begins receiving and sending information to the client until the job is done.
Finally, the server closes the connection to the client and resumes the wait for more
client program requests for services.
CLIENT :
Once a connection is established, the client sends the server whatever data and
instructions are needed to complete the tasks it needs the server to perform. The
client application takes the data it receives from the server, displays it, saves it to a
storage device, prints it or forwards it to other clients on the network.

Page 8
Page 9
DATA FLOW DIAGRAM

0-LEVEL DFD:

1-LEVEL DFD:

Page
10
TECHNOLOGIES USED

Front end as: Netbeans IDE version

Back end as: JAVA

Forms: JFRAME,

MINIMUM REQUIREMENTS

System Requirements:
Operating System: Microsoft® Windows® XP/Vista/window7/linux
Processor: 1 Ghz
Memory: 512 MB RAM
Hard Disk Space: 45 MB Available HDD Space
Video Card: 3D graphics accelerator equivalent to GF6200 or higher
Sound Card: 16-bit Sound Card
DirectX® Version: DirectX® 9.0c

Page
11
CODING

1.LOGIN Page

package logins;

import javax.swing.JOptionPane;

import java.awt.Toolkit;

import java.awt.event.WindowEvent;

import logins.login_s;

public class login extends javax.swing.JFrame {

public login() {

initComponents();

@SuppressWarnings("unchecked")

// <editor-fold defaultstate="collapsed" desc="Generated Code">

private void initComponents() {

jPanel1 = new javax.swing.JPanel();

jLabel1 = new javax.swing.JLabel();

jLabel2 = new javax.swing.JLabel();

username = new javax.swing.JTextField();

password = new javax.swing.JPasswordField();

login = new javax.swing.JButton();

Page
12
reset = new javax.swing.JButton();

cancel = new javax.swing.JButton();

setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE);

setPreferredSize(new java.awt.Dimension(500, 400));

jPanel1.setBorder(javax.swing.BorderFactory.createLineBorder(new java.awt.Color(0, 0,
0), 30));

jLabel1.setText("USERNAME");

jLabel2.setText("PASSWORD");

username.setFont(new java.awt.Font("Tahoma", 1, 11)); // NOI18N

username.setBorder(javax.swing.BorderFactory.createLineBorder(new java.awt.Color(0, 0,
0)));

password.setFont(new java.awt.Font("Tahoma", 1, 11)); // NOI18N

password.setBorder(javax.swing.BorderFactory.createLineBorder(new java.awt.Color(0, 0,
0)));

login.setText("LOGIN");

Page
13
login.addActionListener(new java.awt.event.ActionListener() {

public void actionPerformed(java.awt.event.ActionEvent evt) {

loginActionPerformed(evt);

});

reset.setText("RESET");

reset.addActionListener(new java.awt.event.ActionListener() {

public void actionPerformed(java.awt.event.ActionEvent evt) {

resetActionPerformed(evt);

});

cancel.setText("CANCEL");

cancel.addActionListener(new java.awt.event.ActionListener() {

public void actionPerformed(java.awt.event.ActionEvent evt) {

cancelActionPerformed(evt);

});

javax.swing.GroupLayout jPanel1Layout = new javax.swing.GroupLayout(jPanel1);

Page
14
jPanel1.setLayout(jPanel1Layout);

jPanel1Layout.setHorizontalGroup(

jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)

.addGroup(jPanel1Layout.createSequentialGroup()

.addGap(29, 29, 29)

.addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING,
false)

.addGroup(jPanel1Layout.createSequentialGroup()

.addComponent(login)

.addGap(18, 18, 18)

.addComponent(reset)

.addGap(18, 18, 18)

.addComponent(cancel))

.addGroup(jPanel1Layout.createSequentialGroup()

.addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING,
false)

.addComponent(jLabel1, javax.swing.GroupLayout.DEFAULT_SIZE,
javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)

.addComponent(jLabel2, javax.swing.GroupLayout.DEFAULT_SIZE, 73,


Short.MAX_VALUE))

.addGap(26, 26, 26)

Page
15
.addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)

.addComponent(password)

.addComponent(username))))

.addContainerGap(82, Short.MAX_VALUE))

);

jPanel1Layout.setVerticalGroup(

jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)

.addGroup(jPanel1Layout.createSequentialGroup()

.addGap(63, 63, 63)

.addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELIN
E)

.addComponent(jLabel1)

.addComponent(username, javax.swing.GroupLayout.PREFERRED_SIZE,
javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))

.addGap(29, 29, 29)

.addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELIN
E)

.addComponent(jLabel2)

.addComponent(password, javax.swing.GroupLayout.PREFERRED_SIZE,
javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))

Page
16
.addGap(49, 49, 49)

.addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELIN
E)

.addComponent(login)

.addComponent(reset)

.addComponent(cancel))

.addContainerGap(80, Short.MAX_VALUE))

);

javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane());

getContentPane().setLayout(layout);

layout.setHorizontalGroup(

layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)

.addGroup(layout.createSequentialGroup()

.addGap(20, 20, 20)

.addComponent(jPanel1, javax.swing.GroupLayout.PREFERRED_SIZE,
javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)

.addContainerGap(22, Short.MAX_VALUE))

);

layout.setVerticalGroup(

layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)

Page
17
.addGroup(javax.swing.GroupLayout.Alignment.TRAILING,
layout.createSequentialGroup()

.addContainerGap(34, Short.MAX_VALUE)

.addComponent(jPanel1, javax.swing.GroupLayout.PREFERRED_SIZE,
javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)

.addGap(22, 22, 22))

);

pack();

}// </editor-fold>

private void cancelActionPerformed(java.awt.event.ActionEvent evt) {

System.exit(0); // TODO add your handling code here:

private void resetActionPerformed(java.awt.event.ActionEvent evt) {

password.setText(null);

username.setText(null);// TODO add your handling code here:

private void loginActionPerformed(java.awt.event.ActionEvent evt) {

String pass=password.getText();

Page
18
String user=username.getText();

if (pass.contains("chat") && (user.contains("chat")))

password.setText(null);

username.setText(null);

systemExit();

login_s Info=new login_s();

Info.setVisible(true);

else

JOptionPane.showMessageDialog(null,"Invalid Login Details","Login


Error",JOptionPane.ERROR_MESSAGE);

password.setText(null);

username.setText(null);

}// TODO add your handling code here:

/**

* @param args the command line arguments

*/

Page
19
public static void main(String args[]) {

try {

for (javax.swing.UIManager.LookAndFeelInfo info :


javax.swing.UIManager.getInstalledLookAndFeels()) {

if ("Nimbus".equals(info.getName())) {

javax.swing.UIManager.setLookAndFeel(info.getClassName());

break;

} catch (ClassNotFoundException ex) {

java.util.logging.Logger.getLogger(login.class.getName()).log(java.util.logging.Level.SEVERE,
null, ex);

} catch (InstantiationException ex) {

java.util.logging.Logger.getLogger(login.class.getName()).log(java.util.logging.Level.SEVERE,
null, ex);

} catch (IllegalAccessException ex) {

java.util.logging.Logger.getLogger(login.class.getName()).log(java.util.logging.Level.SEVERE,
null, ex);

} catch (javax.swing.UnsupportedLookAndFeelException ex) {

Page
20
java.util.logging.Logger.getLogger(login.class.getName()).log(java.util.logging.Level.SEVERE,
null, ex);

java.awt.EventQueue.invokeLater(new Runnable() {

public void run() {

new login().setVisible(true);

});

private javax.swing.JButton cancel;

private javax.swing.JLabel jLabel1;

private javax.swing.JLabel jLabel2;

private javax.swing.JPanel jPanel1;

private javax.swing.JButton login;

private javax.swing.JPasswordField password;

private javax.swing.JButton reset;

private javax.swing.JTextField username;

private void systemExit()

WindowEvent WinCloseing = new WindowEvent(this,WindowEvent.WINDOW_CLOSING);

Page
21
}

USER Page

package logins;

import javax.swing.JOptionPane;

import java.awt.Toolkit;

import java.awt.event.WindowEvent;

import logins.Server;

import logins.Client;

public class login_s extends javax.swing.JFrame {

public login_s() {

initComponents();

@SuppressWarnings("unchecked")

// <editor-fold defaultstate="collapsed" desc="Generated Code">

private void initComponents() {

jPanel1 = new javax.swing.JPanel();

jLabel1 = new javax.swing.JLabel();

jButton1 = new javax.swing.JButton();

jButton2 = new javax.swing.JButton();

setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE);

Page
22
jLabel1.setText("Select Server and Client");

jButton1.setText("SERVER");

jButton1.addActionListener(new java.awt.event.ActionListener() {

public void actionPerformed(java.awt.event.ActionEvent evt) {

jButton1ActionPerformed(evt);

});

jButton2.setText("CLIENT");

jButton2.addActionListener(new java.awt.event.ActionListener() {

public void actionPerformed(java.awt.event.ActionEvent evt) {

jButton2ActionPerformed(evt);

});

javax.swing.GroupLayout jPanel1Layout = new javax.swing.GroupLayout(jPanel1);

jPanel1.setLayout(jPanel1Layout);

jPanel1Layout.setHorizontalGroup(

jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)

.addGap(0, 266, Short.MAX_VALUE)

.addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)

.addGroup(jPanel1Layout.createSequentialGroup()

.addGap(44, 44, 44)

.addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)

.addGroup(jPanel1Layout.createSequentialGroup()

.addComponent(jButton1)

Page
23
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED,
javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)

.addComponent(jButton2))

.addComponent(jLabel1, javax.swing.GroupLayout.PREFERRED_SIZE, 178,


javax.swing.GroupLayout.PREFERRED_SIZE))

.addContainerGap(44, Short.MAX_VALUE)))

);

jPanel1Layout.setVerticalGroup(

jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)

.addGap(0, 205, Short.MAX_VALUE)

.addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)

.addGroup(jPanel1Layout.createSequentialGroup()

.addGap(70, 70, 70)

.addComponent(jLabel1, javax.swing.GroupLayout.PREFERRED_SIZE, 23,


javax.swing.GroupLayout.PREFERRED_SIZE)

.addGap(18, 18, 18)

.addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)

.addComponent(jButton1)

.addComponent(jButton2))

.addContainerGap(71, Short.MAX_VALUE)))

);

javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane());

getContentPane().setLayout(layout);

layout.setHorizontalGroup(

Page
24
layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)

.addGroup(layout.createSequentialGroup()

.addGap(116, 116, 116)

.addComponent(jPanel1, javax.swing.GroupLayout.PREFERRED_SIZE,
javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)

.addContainerGap(127, Short.MAX_VALUE))

);

layout.setVerticalGroup(

layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)

.addGroup(layout.createSequentialGroup()

.addGap(81, 81, 81)

.addComponent(jPanel1, javax.swing.GroupLayout.PREFERRED_SIZE,
javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)

.addContainerGap(97, Short.MAX_VALUE))

);

pack();

}// </editor-fold>

private void jButton1ActionPerformed(java.awt.event.ActionEvent evt) {

systemExit();

Server Info=new Server();

Info.setVisible(true); // TODO add your handling code here:

Page
25
private void jButton2ActionPerformed(java.awt.event.ActionEvent evt) {

systemExit();

Client Info=new Client();

Info.setVisible(true); // TODO add your handling code here:

public static void main(String args[]) {

try {

for (javax.swing.UIManager.LookAndFeelInfo info : javax.swing.UIManager.getInstalledLookAndFeels()) {

if ("Nimbus".equals(info.getName())) {

javax.swing.UIManager.setLookAndFeel(info.getClassName());

break;

} catch (ClassNotFoundException ex) {

java.util.logging.Logger.getLogger(login_s.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);

} catch (InstantiationException ex) {

java.util.logging.Logger.getLogger(login_s.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);

} catch (IllegalAccessException ex) {

java.util.logging.Logger.getLogger(login_s.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);

} catch (javax.swing.UnsupportedLookAndFeelException ex) {

java.util.logging.Logger.getLogger(login_s.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);

//</editor-fold>

Page
26
java.awt.EventQueue.invokeLater(new Runnable() {

public void run() {

new login_s().setVisible(true);

});

modify

private javax.swing.JButton jButton1;

private javax.swing.JButton jButton2;

private javax.swing.JLabel jLabel1;

private javax.swing.JPanel jPanel1;

// End of variables declaration

private void systemExit()

WindowEvent WinCloseing = new WindowEvent(this,WindowEvent.WINDOW_CLOSING);

CLIENT:

package logins;

import java.io.DataInputStream;

import java.io.DataOutputStream;

import java.net.Socket;

public class Client extends javax.swing.JFrame {

Page
27
static Socket s;

static DataInputStream dis;

static DataOutputStream dos;

public Client() {

initComponents();

@SuppressWarnings("unchecked")

// <editor-fold defaultstate="collapsed" desc="Generated Code">

private void initComponents() {

jScrollPane1 = new javax.swing.JScrollPane();

msg_area = new javax.swing.JTextArea();

msg_text = new javax.swing.JTextField();

btnSend = new javax.swing.JButton();

setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE);

msg_area.setColumns(20);

msg_area.setRows(5);

jScrollPane1.setViewportView(msg_area);

btnSend.setText("Send");

btnSend.addActionListener(new java.awt.event.ActionListener() {

public void actionPerformed(java.awt.event.ActionEvent evt) {

btnSendActionPerformed(evt);

Page
28
});

javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane());

getContentPane().setLayout(layout);

layout.setHorizontalGroup(

layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)

.addGroup(layout.createSequentialGroup()

.addGap(44, 44, 44)

.addComponent(msg_text, javax.swing.GroupLayout.PREFERRED_SIZE, 258,


javax.swing.GroupLayout.PREFERRED_SIZE)

.addGap(18, 18, 18)

.addComponent(btnSend, javax.swing.GroupLayout.DEFAULT_SIZE,
javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)

.addGap(52, 52, 52))

.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)

.addGroup(layout.createSequentialGroup()

.addContainerGap()

.addComponent(jScrollPane1, javax.swing.GroupLayout.DEFAULT_SIZE, 409,


Short.MAX_VALUE)

.addContainerGap()))

);

layout.setVerticalGroup(

layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)

Page
29
.addGroup(javax.swing.GroupLayout.Alignment.TRAILING, layout.createSequentialGroup()

.addContainerGap(276, Short.MAX_VALUE)

.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)

.addComponent(msg_text, javax.swing.GroupLayout.PREFERRED_SIZE,
javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)

.addComponent(btnSend))

.addContainerGap())

.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)

.addGroup(layout.createSequentialGroup()

.addContainerGap()

.addComponent(jScrollPane1, javax.swing.GroupLayout.PREFERRED_SIZE, 250,


javax.swing.GroupLayout.PREFERRED_SIZE)

.addContainerGap(49, Short.MAX_VALUE)))

);

pack();

}// </editor-fold>

private void btnSendActionPerformed(java.awt.event.ActionEvent evt) {

String msgout="";

try {

msgout=msg_text.getText().trim();

dos.writeUTF("Client: "+msgout);

Page
30
} catch (Exception e) {

public static void main(String args[]) {

try {

for (javax.swing.UIManager.LookAndFeelInfo info :


javax.swing.UIManager.getInstalledLookAndFeels()) {

if ("Nimbus".equals(info.getName())) {

javax.swing.UIManager.setLookAndFeel(info.getClassName());

break;

} catch (ClassNotFoundException ex) {

java.util.logging.Logger.getLogger(Client.class.getName()).log(java.util.logging.Level.SEVERE,
null, ex);

} catch (InstantiationException ex) {

java.util.logging.Logger.getLogger(Client.class.getName()).log(java.util.logging.Level.SEVERE,
null, ex);

} catch (IllegalAccessException ex) {

java.util.logging.Logger.getLogger(Client.class.getName()).log(java.util.logging.Level.SEVERE,
null, ex);

} catch (javax.swing.UnsupportedLookAndFeelException ex) {

java.util.logging.Logger.getLogger(Client.class.getName()).log(java.util.logging.Level.SEVERE,
null, ex);

Page
31
}

java.awt.EventQueue.invokeLater(new Runnable() {

public void run() {

new Client().setVisible(true);

});

String msgin="";

try {

s=new Socket("localhost", 1201);

dis=new DataInputStream(s.getInputStream());

dos=new DataOutputStream(s.getOutputStream());

while(!msgin.equals("exit")){

msgin=dis.readUTF();

msg_area.setText(msg_area.getText().trim()+"\n"+msgin);

} catch (Exception e) {

e.printStackTrace();

// Variables declaration - do not modify

private javax.swing.JButton btnSend;

Page
32
private javax.swing.JScrollPane jScrollPane1;

private static javax.swing.JTextArea msg_area;

private javax.swing.JTextField msg_text;

SERVER:

package logins;

import java.io.DataInputStream;

import java.io.DataOutputStream;

import java.io.File;

import java.net.ServerSocket;

import java.net.Socket;

import javax.swing.JFileChooser;

public class Server extends javax.swing.JFrame {

static ServerSocket ss;

static Socket s;

static DataInputStream dis;

static DataOutputStream dos;/** Creates new form Server */

public Server() {

initComponents();

@SuppressWarnings("unchecked")

// <editor-fold defaultstate="collapsed" desc="Generated Code">

Page
33
private void initComponents() {

jScrollPane1 = new javax.swing.JScrollPane();

msg_area = new javax.swing.JTextArea();

msg_text = new javax.swing.JTextField();

btnSend = new javax.swing.JButton();

setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE);

msg_area.setColumns(20);

msg_area.setRows(5);

jScrollPane1.setViewportView(msg_area);

msg_text.addActionListener(new java.awt.event.ActionListener() {

public void actionPerformed(java.awt.event.ActionEvent evt) {

msg_textActionPerformed(evt);

});

btnSend.setText("Send");

btnSend.addActionListener(new java.awt.event.ActionListener() {

public void actionPerformed(java.awt.event.ActionEvent evt) {

btnSendActionPerformed(evt);

});

javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane());

Page
34
getContentPane().setLayout(layout);

layout.setHorizontalGroup(

layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)

.addComponent(jScrollPane1)

.addGroup(layout.createSequentialGroup()

.addComponent(msg_text, javax.swing.GroupLayout.PREFERRED_SIZE, 281,


javax.swing.GroupLayout.PREFERRED_SIZE)

.addGap(18, 18, 18)

.addComponent(btnSend, javax.swing.GroupLayout.DEFAULT_SIZE, 83,


Short.MAX_VALUE))

);

layout.setVerticalGroup(

layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)

.addGroup(layout.createSequentialGroup()

.addComponent(jScrollPane1, javax.swing.GroupLayout.PREFERRED_SIZE, 242,


javax.swing.GroupLayout.PREFERRED_SIZE)

.addGap(18, 18, 18)

.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)

.addComponent(msg_text, javax.swing.GroupLayout.PREFERRED_SIZE, 28,


javax.swing.GroupLayout.PREFERRED_SIZE)

.addComponent(btnSend))

.addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))

);

pack();

Page
35
}// </editor-fold>

private void msg_textActionPerformed(java.awt.event.ActionEvent evt) {

private void btnSendActionPerformed(java.awt.event.ActionEvent evt) {

String msgout="";

try {

msgout=msg_text.getText().trim();

dos.writeUTF("Server: "+msgout);

} catch (Exception e) {

public static void main(String args[]) {

java.awt.EventQueue.invokeLater(new Runnable() {

public void run() {

new Server().setVisible(true);

});

String msgin = "";

try {

ss = new ServerSocket(1201);

s = ss.accept();

Page
36
dis = new DataInputStream(s.getInputStream());

dos = new DataOutputStream(s.getOutputStream());

while (!msgin.equals("exit")) {

msgin = dis.readUTF();

msg_area.setText(msg_area.getText().trim() + "\n" + msgin);

} catch (Exception e) {

e.printStackTrace();

Page
37
FUTURE SCOPE

Jabber framework can be used for instant messaging.


Session initiation protocol [SIP] can help us to provide this TEXT chat special
features such as voice and video chat

Page
38
CONCLUSION

The browser is developed using java, jframe and fully meets the objectives of the
system for which it has been developed.
.

Page
39
Bibliography:
I have taken help from the following sources:

Books
Java Programming for Beginners BY Daniel Lorig
Thinking in JAVA
Web
WWW.CODEACADEMY.COM
WWW.TUTORIALSPOINT.COM
WWW.GEEKSFORGEEKS.ORG

Page
40

Vous aimerez peut-être aussi