เสร็จสมบูรณ์

Java server chat system

i need to build a small server chat system i have a lot of code to give but need help putting it together

Use the given files to create a complete chat system with java. simple is better.
the chat code/java files will be bellow are the 'ChatFrame' 'ChatHandler' 'ChatServer' 'ListFrame' 'MyCardFrame'.
Use card layout to obtain name from user.
Prepend name to messages sent.
Announce entrances and exits from the chat.
Working user list of all user within chat.
Private messages to user within the chat.
Please base the code off of the code already given.




//ChatFrame.java
import java.awt.*;
import java.awt.event.*;
import java.io.*;
import java.net.*;

public class ChatFrame extends Frame{
public ChatFrame(){
setSize(500,500);
setTitle("Echo Client");
addWindowListener(new WindowAdapter(){
public void windowClosing(WindowEvent we){
System.exit(0);
}
});
ChatPanel cp = new ChatPanel();
add(cp, BorderLayout.CENTER);
setVisible(true);
}
public static void main(String[] args){
ChatFrame cf = new ChatFrame();
}
}
class ChatPanel extends Panel implements ActionListener, Runnable{
TextField tf;
TextArea ta;
Socket s;
PrintWriter send;
BufferedReader rec;
Thread t;
Button connect, disconnect;

public ChatPanel(){
setLayout(new BorderLayout());
tf = new TextField();
tf.addActionListener(this);
add(tf, BorderLayout.NORTH);
ta = new TextArea();
add(ta, BorderLayout.CENTER);
//new stuff below
connect = new Button("Connect");
connect.addActionListener(this);
disconnect = new Button("Disconnect");
disconnect.addActionListener(this);
disconnect.setEnabled(false);
Panel p = new Panel();
p.add(connect);
p.add(disconnect);
add(p, BorderLayout.SOUTH);

}

public void actionPerformed(ActionEvent ae){
if(ae.getSource()==tf){
String temp = tf.getText();
send.println(temp);
tf.setText("");
}else if(ae.getSource() == connect){
try{
s = new Socket("localhost", 3000);
send = new PrintWriter(s.getOutputStream(), true);
rec = new BufferedReader(new InputStreamReader(
s.getInputStream()));

}catch(UnknownHostException uhe){
System.out.println(uhe.getMessage());
}catch(IOException ioe){
System.out.println(ioe.getMessage());
}
t = new Thread(this, "whatever");
t.start();
connect.setEnabled(false);
disconnect.setEnabled(true);

}else if(ae.getSource() == disconnect){
//how to kill connection?
send.println("BYE");
send = null;
rec = null;
s = null;
t = null;

disconnect.setEnabled(false);
connect.setEnabled(true);
}
}
public void run(){
String temp = "";
try{
while(((temp = rec.readLine()) != null) && (t != null)){
ta.append(temp + "
");

ทักษะ: Coding, Java, Programming

ดูเพิ่มเติม : client server chat code gui java, source code java nio server chat, small project code java scripts html, client server chat program in java using swing, chat server in java using socket programming, multiple client server chat program in java, client server chat program in java using threads, chat server in java project, client server chat program in java source code, simple chat application in java source code, chat server in java source code, simple java live chat code, java socket chat system source code, java server code store scores, finish project java client server chat, download java version 0_22 javatm runtime environment standard edition build 0_22b03 java hotspottm 64bit server vm build , description simple client server chat project java, chat application asp net code project client server, small source code college erp solution java, build simple client server chat

เกี่ยวกับนายจ้าง:
( 0 บทวิจารณ์ ) United States

หมายเลขโปรเจค: #15784912

มอบให้กับ:

AhmedLabib93

Hello I'm expert java developer with experience in object oriented, data structure, swing, javafx and more advanced concepts. I can help you to finish this project with great quality. Regards Relevant Skills and Exper เพิ่มเติม

$80 USD ใน 4 วัน
(366 บทวิจารณ์)
6.5

freelancer 6 คน กำลังเสนอราคาเฉลี่ยที่ $131 สำหรับงานนี้

$100 USD ใน 2 วัน
(237 บทวิจารณ์)
6.5
BeshoyMousaKhair

. Relevant Skills and Experience . Proposed Milestones $120 USD - .

$120 USD ใน 3 วัน
(23 บทวิจารณ์)
3.8
$55 USD ใน 1 วัน
(4 บทวิจารณ์)
2.7
poojamehta23

Developed several projects with chat functionality. Will develop our own modules to deliver chat project. Relevant Skills and Experience Highly experienced and very comfortable to deliver chat project. Developed chat เพิ่มเติม

$277 USD ใน 3 วัน
(0 บทวิจารณ์)
0.0
$155 USD ใน 1 วัน
(0 บทวิจารณ์)
0.0