Introduction - If you have any usage issues, please Google them yourself
import java.io.*
import java.awt. event.*
import javax.swing.*
import java.net.*
public class ChatClient implements ActionListener
{
private Panel panel
private JTextArea said
private JTextField chat
private JButton send
private ServerSocket server
private Socket s
private InputStream in
private OutputStream out
public ChatClient()
{
JFrame f=new JFrame("聊天系统客户机端")
f.setSize(350,400)
panel=new Panel()
said=new JTextArea()
chat=new JTextField(20)
chat.addActionListener(this)
send=new JButton("发送")
send.addActionListener(this)
panel.add(chat)
panel.add(send)
f.add("South",panel)
f.add("Center",said)
f.addWindowListener(new WindowAdapter()
{
public void windowClosing(WindowEvent e)
{
System.exit(0)
}
})
f.show()
}
public void startN