资源简介
用java CS 模式实现的简单版的java实现的仿qq聊天程序,有上线下线弹窗提醒、聊天、上传头像、自动更新好友列表、自动加载好友信息、发送消息、发送文件等功能,减压后的文件夹下附有说明文件。
程序启动方法:
1、先打开目录SimpleChatServer 下的ChatServer.bat
2、然后再打开SimpleChatClient 下的ChatClient.bat

代码片段和文件信息
package com.lee.client;
import java.awt.BorderLayout;
import java.awt.Color;
import java.awt.Image;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import java.awt.event.InputEvent;
import java.awt.event.KeyEvent;
import java.awt.event.MouseAdapter;
import java.awt.event.MouseEvent;
import java.awt.event.WindowEvent;
import java.awt.event.WindowListener;
import java.io.BufferedReader;
import java.io.DataInputStream;
import java.io.DataOutputStream;
import java.io.File;
import java.io.FileInputStream;
import java.io.FileOutputStream;
import java.io.IOException;
import java.io.InputStreamReader;
import java.io.PrintWriter;
import java.net.ServerSocket;
import java.net.Socket;
import java.util.Date;
import java.util.linkedList;
import javax.swing.JButton;
import javax.swing.JComponent;
import javax.swing.JFileChooser;
import javax.swing.Jframe;
import javax.swing.JLabel;
import javax.swing.JOptionPane;
import javax.swing.JPanel;
import javax.swing.JProgressBar;
import javax.swing.JScrollPane;
import javax.swing.JTextArea;
import javax.swing.KeyStroke;
import javax.swing.filechooser.FileFilter;
import com.lee.comm.ClientTransfer;
import com.lee.comm.MyImageButton;
import com.lee.comm.MyImagePanel;
import com.lee.comm.MyMouseListener;
import com.lee.comm.ServerTransfer;
import com.lee.comm.user.User;
import com.lee.comm.util.frameUtil;
import com.lee.comm.util.ImageUtil;
/**
* 聊天窗口
* */
public class ClientChatframe extends Jframe{
private JTextArea txt_sign;
private JTextArea showArea;
private JTextArea inputArea;
private static final long serialVersionUID = 1L;
private Image image = null;
private static Image defaultUserImg = null;
private JPanel mainPanel;
private User user;
private ClientMainframe parentframe;
private ClientChatframe $this = this;
private JButton btn_minbtn_closebtn_upload;
private JProgressBar progressBar;
private MouseHander hander = new MouseHander();
private File selectedFile;
private boolean isSend = false;
private boolean isReceive = false;
private JLabel label_info;
private static int transFileSize = 1024; //傳輸的文件数组初始化大小
static
{
try {
defaultUserImg = ImageUtil.getDefaultUserImage();
} catch (Exception e) {
e.printStackTrace();
}
}
{
try {
image = ImageUtil.getImageByPath(ImageUtil.systemImagePath(“square7.jpg“));
} catch (Exception e) {
e.printStackTrace();
}
}
public ClientChatframe(User user ClientMainframe mainframe) throws Exception
{
super();
this.user = user;
this.parentframe = mainframe;
this.setUndecorated(true);
MyMouseListener draglistener = new MyMouseListener(this);
this.addMouseMotionListener(draglistener);
this.addMouseListener(draglistener);
init();
}
public void init() throws Exception
{
settitle(“聊天窗口:“+user.getNickName());
frameUtil.setframeLocationCenter(this 450 450);
//this.se
属性 大小 日期 时间 名称
----------- --------- ---------- ----- ----
目录 0 2013-12-08 23:47 SimpleChat\
目录 0 2013-12-08 23:46 SimpleChat\SimpleChatClient\
文件 232 2013-11-26 15:32 SimpleChat\SimpleChatClient\.classpath
文件 392 2013-12-08 22:07 SimpleChat\SimpleChatClient\.project
目录 0 2013-12-08 23:46 SimpleChat\SimpleChatClient\.settings\
文件 629 2013-11-26 15:31 SimpleChat\SimpleChatClient\.settings\org.eclipse.jdt.core.prefs
文件 98 2013-12-08 23:27 SimpleChat\SimpleChatClient\ChatClient.bat
目录 0 2013-12-08 23:46 SimpleChat\SimpleChatClient\bin\
目录 0 2013-12-08 23:46 SimpleChat\SimpleChatClient\bin\com\
目录 0 2013-12-08 23:46 SimpleChat\SimpleChatClient\bin\com\lee\
目录 0 2013-12-08 23:46 SimpleChat\SimpleChatClient\bin\com\lee\client\
文件 1973 2013-12-08 23:12 SimpleChat\SimpleChatClient\bin\com\lee\client\ClientChatfr
文件 1897 2013-12-08 23:12 SimpleChat\SimpleChatClient\bin\com\lee\client\ClientChatfr
文件 2072 2013-12-08 23:12 SimpleChat\SimpleChatClient\bin\com\lee\client\ClientChatfr
文件 4130 2013-12-08 23:12 SimpleChat\SimpleChatClient\bin\com\lee\client\ClientChatfr
文件 1165 2013-12-08 23:12 SimpleChat\SimpleChatClient\bin\com\lee\client\ClientChatfr
文件 6002 2013-12-08 23:12 SimpleChat\SimpleChatClient\bin\com\lee\client\ClientChatfr
文件 3043 2013-12-08 23:12 SimpleChat\SimpleChatClient\bin\com\lee\client\ClientChatfr
文件 11236 2013-12-08 23:12 SimpleChat\SimpleChatClient\bin\com\lee\client\ClientChatfr
文件 1904 2013-12-08 22:20 SimpleChat\SimpleChatClient\bin\com\lee\client\ClientLoginfr
文件 1615 2013-12-08 22:20 SimpleChat\SimpleChatClient\bin\com\lee\client\ClientLoginfr
文件 7232 2013-12-08 22:20 SimpleChat\SimpleChatClient\bin\com\lee\client\ClientLoginfr
文件 1511 2013-12-08 23:16 SimpleChat\SimpleChatClient\bin\com\lee\client\ClientMainfr
文件 1022 2013-12-08 23:16 SimpleChat\SimpleChatClient\bin\com\lee\client\ClientMainfr
文件 4702 2013-12-08 23:16 SimpleChat\SimpleChatClient\bin\com\lee\client\ClientMainfr
文件 5372 2013-12-08 23:16 SimpleChat\SimpleChatClient\bin\com\lee\client\ClientMainfr
文件 16415 2013-12-08 23:16 SimpleChat\SimpleChatClient\bin\com\lee\client\ClientMainfr
文件 1979 2013-12-08 22:07 SimpleChat\SimpleChatClient\bin\com\lee\client\ClientRegistfr
文件 1042 2013-12-08 22:07 SimpleChat\SimpleChatClient\bin\com\lee\client\ClientRegistfr
文件 1627 2013-12-08 22:07 SimpleChat\SimpleChatClient\bin\com\lee\client\ClientRegistfr
文件 10064 2013-12-08 22:07 SimpleChat\SimpleChatClient\bin\com\lee\client\ClientRegistfr
............此处省略223个文件信息
- 上一篇:白话 C++ 完整版
- 下一篇:兔子跳铃铛 android游戏源码
相关资源
- java图片浏览器跨平台运行程序与源码
- 基于java的在线考试系统-毕业设计
- 微博系统(Java源码,servlet+jsp),适
- java串口通信全套完整代码-导入eclip
- jsonarray所必需的6个jar包.rar
- 三角网构TIN生成算法,Java语言实现
- java代码编写将excel数据导入到mysql数据
- Java写的cmm词法分析器源代码及javacc学
- JAVA JSP公司财务管理系统 源代码 论文
- JSP+MYSQL旅行社管理信息系统
- 推荐算法的JAVA实现
- 基于Java的酒店管理系统源码(毕业设
- java-图片识别 图片比较
- android毕业设计
- java23种设计模式+23个实例demo
- java Socket发送/接受报文
- JAVA828436
- java界面美化 提供多套皮肤直接使用
- 在线聊天系统(java代码)
- 基于Java的图书管理系统807185
- java中实现将页面数据导入Excel中
- java 企业销售管理系统
- java做的聊天系统(包括正规课程设计
- Java编写的qq聊天室
- 商店商品管理系统 JAVA写的 有界面
- JAVA开发聊天室程序
- 在linux系统下用java执行系统命令实例
- java期末考试试题两套(答案) 选择(
- JAVA3D编程示例(建模、交互)
- Java 文件加密传输
评论
共有 条评论