文件名称:ChatRoom
-
所属分类:
- 标签属性:
- 上传时间:2012-11-16
-
文件大小:5.99kb
-
已下载:0次
-
提 供 者:
-
相关连接:无下载说明:别用迅雷下载,失败请重下,重下不扣分!
介绍说明--下载内容来自于网络,使用问题请自行百度
实现了java环境下一对一的私人聊天功能-import java.io.*
import java.awt.*
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
import java.awt.*
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
(系统自动生成,下载前可以参看下载内容)
下载文件列表
Client/ChatMessage.java
Client/ChatWindow.java
Client/Login.java
Client/UserName.java
Server/ServerLout.java
Server/ServerMessage.java
Server/ServerStart.java
Server/SuserName.java
.classpath
说明.txt
Client
Server
Client/ChatWindow.java
Client/Login.java
Client/UserName.java
Server/ServerLout.java
Server/ServerMessage.java
Server/ServerStart.java
Server/SuserName.java
.classpath
说明.txt
Client
Server
本网站为编程资源及源代码搜集、介绍的搜索网站,版权归原作者所有! 粤ICP备11031372号
1999-2046 搜珍网 All Rights Reserved.