资源简介

该程序为java+socket+swing+多线程实现的简易QQ聊天系统,可以实现群聊以及私聊的功能,私聊的格式为@用户1/2/3...:消息。

资源截图

代码片段和文件信息

package com.Socket.tcp.chatRoom;

import java.awt.FlowLayout;
import java.awt.GridBagConstraints;
import java.awt.GridBagLayout;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import java.io.BufferedReader;
import java.io.BufferedWriter;
import java.io.DataOutputStream;
import java.io.IOException;
import java.io.InputStreamReader;
import java.io.OutputStreamWriter;
import java.io.PrintWriter;
import java.net.Socket;
import javax.swing.JButton;
import javax.swing.Jframe;
import javax.swing.JLabel;
import javax.swing.JOptionPane;
import javax.swing.JPanel;
import javax.swing.JTextArea;
import javax.swing.JTextField;

/**编写聊天界面类
 * 1、框架(Jframe)
 * 2、面板(JPanel)
 * 先要创建布局(这里主要是GridBagLayout) 布局可以管理容器
 * 3、容器(container)  容器里面可以存放组件
 * 4、组件(co

 属性            大小     日期    时间   名称
----------- ---------  ---------- -----  ----
     目录           0  2018-10-26 16:18  SimpleChatRoom2\
     文件         301  2018-10-26 16:18  SimpleChatRoom2\.classpath
     文件         391  2018-10-26 16:18  SimpleChatRoom2\.project
     目录           0  2018-10-26 16:18  SimpleChatRoom2\.settings\
     文件         598  2018-10-26 16:18  SimpleChatRoom2\.settings\org.eclipse.jdt.core.prefs
     目录           0  2018-12-10 10:22  SimpleChatRoom2\bin\
     目录           0  2018-12-10 10:22  SimpleChatRoom2\bin\com\
     目录           0  2018-12-10 10:22  SimpleChatRoom2\bin\com\Socket\
     目录           0  2018-12-10 10:22  SimpleChatRoom2\bin\com\Socket\tcp\
     目录           0  2018-12-10 14:33  SimpleChatRoom2\bin\com\Socket\tcp\chatRoom\
     文件         846  2018-12-11 10:20  SimpleChatRoom2\bin\com\Socket\tcp\chatRoom\Client.class
     文件        1971  2018-12-11 10:20  SimpleChatRoom2\bin\com\Socket\tcp\chatRoom\Receive.class
     文件        3444  2018-12-11 10:20  SimpleChatRoom2\bin\com\Socket\tcp\chatRoom\Server$Multichannel.class
     文件        1852  2018-12-11 10:20  SimpleChatRoom2\bin\com\Socket\tcp\chatRoom\Server.class
     文件        3681  2018-12-11 10:20  SimpleChatRoom2\bin\com\Socket\tcp\chatRoom\chatRoomGUI.class
     目录           0  2018-10-26 16:18  SimpleChatRoom2\src\
     目录           0  2018-10-26 16:18  SimpleChatRoom2\src\com\
     目录           0  2018-10-26 16:18  SimpleChatRoom2\src\com\Socket\
     目录           0  2018-10-26 16:18  SimpleChatRoom2\src\com\Socket\tcp\
     目录           0  2018-12-10 14:33  SimpleChatRoom2\src\com\Socket\tcp\chatRoom\
     文件         478  2018-12-11 10:20  SimpleChatRoom2\src\com\Socket\tcp\chatRoom\Client.java
     文件        1375  2018-12-11 10:20  SimpleChatRoom2\src\com\Socket\tcp\chatRoom\Receive.java
     文件        3484  2018-12-11 10:20  SimpleChatRoom2\src\com\Socket\tcp\chatRoom\Server.java
     文件        3821  2018-12-11 10:20  SimpleChatRoom2\src\com\Socket\tcp\chatRoom\chatRoomGUI.java

评论

共有 条评论