資源簡介
用java編寫的局域網聊天,可以群聊和私聊
代碼片段和文件信息
import?java.io.*;
import?java.net.*;
import?java.awt.*;
import?java.awt.event.*;
class?ClientWindows?extends?frame?implements?ActionListenerWindowListenerTextListenerItemListenerKeyListener{
TextArea?chatRecord; //聊天區域
TextField?msgEditor; //發送的聊天信息
Label?transNamewelcomeInfofriendInfo; //一些輔助信息
Button?sendButton; //發送按鈕
public?List?friendList; //好友列表
Socket?transferSocket; //與服務器連接的socket
PrintWriter?socketWriter; //輸出流對象
Font?allFont;? //字體
public?String?nick; //使用的昵稱
ClientWindows(String?windowsName){ //圖形界面的初始化
super(windowsName);
allFont=new?Font(“宋體“Font.TRUETYPE_FONT16);
this.setName(windowsName);
this.setSize(600?528);
this.setLayout(null);
this.setBackground(Color.LIGHT_GRAY);
this.setResizable(false);
addWindowListener(this); //向WindowListener中添加本窗口
chatRecord=new?TextArea();
chatRecord.setLocation(032);
chatRecord.set
?屬性????????????大小?????日期????時間???名稱
-----------?---------??----------?-----??----
?????文件???????7022??2008-05-29?13:58??聊天軟件\ClientWindows.class
?????文件????????498??2008-05-29?13:58??聊天軟件\GraphClient.class
?????文件???????8057??2008-05-29?13:58??聊天軟件\GraphClient.java
?????文件???????2428??2008-05-29?13:58??聊天軟件\ReceiveThread.class
?????文件???????1595??2008-05-29?13:42??聊天軟件\Server.class
?????文件???????5247??2008-05-29?13:42??聊天軟件\Server.java
?????文件???????4578??2008-05-29?13:42??聊天軟件\SocketThread.class
?????目錄??????????0??2008-11-26?11:12??聊天軟件
-----------?---------??----------?-----??----
????????????????29425????????????????????8
- 上一篇:java 生成并excel
- 下一篇:java 局域網簡單socket通信,帶界面
評論
共有 條評論