文件名称:ChatRoom
- 所属分类:
- JSP源码/Java
- 资源属性:
- [Java] [源码]
- 上传时间:
- 2012-11-26
- 文件大小:
- 6kb
- 下载次数:
- 0次
- 提 供 者:
- gd***
- 相关连接:
- 无
- 下载说明:
- 别用迅雷下载,失败请重下,重下不扣分!
介绍说明--下载内容均来自于网络,请自行研究使用
实现了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()
{
Jfr a me f=new Jfr a me("聊天系统客户机端")
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()
{
Jfr a me f=new Jfr a me("聊天系统客户机端")
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
......\ChatWindow.java
......\Login.java
......\UserName.java
Server\ServerLout.java
......\ServerMessage.java
......\ServerStart.java
......\SuserName.java
.classpath
说明.txt
Client
Server
......\ChatWindow.java
......\Login.java
......\UserName.java
Server\ServerLout.java
......\ServerMessage.java
......\ServerStart.java
......\SuserName.java
.classpath
说明.txt
Client
Server