package Server;
import java.awt.AWTException;
import java.awt.BorderLayout;
import java.awt.Color;
import java.awt.Image;
import java.awt.List;
import java.awt.MenuItem;
import java.awt.PopupMenu;
import java.awt.SystemTray;
import java.awt.Toolkit;
import java.awt.TrayIcon;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import java.awt.event.MouseAdapter;
import java.awt.event.MouseEvent;
import java.awt.event.MouseListener;
import java.awt.event.WindowEvent;
import java.awt.event.WindowListener;
import java.util.ArrayList;
import javax.swing.DefaultListModel;
import javax.swing.Icon;
import javax.swing.ImageIcon;
import javax.swing.JButton;
import javax.swing.JDialog;
import javax.swing.JFrame;
import javax.swing.JLabel;
import javax.swing.JList;
import javax.swing.JOptionPane;
import javax.swing.JPanel;
import javax.swing.JTabbedPane;
import javax.swing.JTextArea;
import javax.swing.ListSelectionModel;
import net.sf.json.JSONArray;
import net.sf.json.JSONException;
import net.sf.json.JSONObject;
import vo.*;
import javax.swing.event.ChangeEvent;
import javax.swing.event.ChangeListener;
import javax.swing.event.ListSelectionEvent;
import javax.swing.event.ListSelectionListener;
import ImageList.ImageList;
import Login.LoginView;
import Main.BgWindow;
import Main.InfoImage;
import Window.ChatWindow;
import Window.PersonInfo;
import javax.swing.JScrollPane;
import javax.swing.JToolBar;
import javax.swing.JTextField;
import javax.swing.JRadioButton;
import javax.swing.SwingConstants;
public class Customer implements ActionListener {
private JFrame jframe;
private static final long serialVersionUID = -5832302420914722347L;
private JPanel plAll = new JPanel();
private static List allChat = new List();
private JPanel plOne = new JPanel();
private static List oneChat = new List();
private JPanel plSend = new JPanel(new BorderLayout());
private JTextArea sendMsg = new JTextArea();
private JButton btnSend = new JButton("发送");
private JButton sendAll = new JButton("创建全体消息");
private JPanel plSearch = new JPanel();
private JPanel plUser_msg = new JPanel();
private static JTabbedPane tab;
static String line = null;
static User user = null;
static ArrayList<String> list = new ArrayList<String>(); // 保存打开的窗口信息
static int all_info = 0; // 设置收到的所有人信息的条数
static int one_info = 0; // 设置收到的个人信息得到条数
static JList userList;
static DefaultListModel listModel;
static int j = 0; // 列表项
private JScrollPane js;
private final JTextField search = new JTextField();
private static List search_list;
private static JButton refresh = new JButton();
private static ArrayList<Search> search_info = new ArrayList<Search>();
private static ArrayList<AllUser> AllUserList = new ArrayList<AllUser>();
public Customer(User user) {
search.setHorizontalAlignment(SwingConstants.CENTER);
search.setBounds(0, 0, 269, 26);
search.setBackground(Color.WHITE);
search.setColumns(10);
this.user = user;
jframe = new JFrame();
BgWindow.WidnowBackground(jframe);
jframe.getContentPane().setBackground(Color.WHITE);
plSend.add(sendMsg, BorderLayout.CENTER);
plSend.add(btnSend, BorderLayout.EAST);
plUser_msg.setBackground(Color.WHITE);
plUser_msg.setBounds(0, 0, 181, 392);
plUser_msg.setLayout(null);
plOne.setBackground(Color.WHITE);
plOne.setBounds(380, 0, 200, 392);
plOne.setLayout(null);
oneChat.setEnabled(false);
oneChat.setBackground(Color.WHITE);
oneChat.select(-1);
oneChat.setBounds(30, 180, 203, 283);
oneChat.add("");
oneChat.add("账号:" + user.getTel());
oneChat.add("");
oneChat.add("昵称:" + user.getAccount());
oneChat.add("");
oneChat.add("签名:" + user.getQianming());
oneChat.add("");
oneChat.add("性别:" + user.getSex());
oneChat.add("");
if (user.getAdmin() == 0) {
oneChat.add("管理员权限:无");
} else {
oneChat.add("管理员权限:已获得");
}
plOne.add(oneChat);
JLabel label = new JLabel(InfoImage.InfoImage());
label.setBackground(Color.WHITE);
label.setBounds(30, 30, 203, 120);
plOne.add(label);
plAll.setBackground(Color.WHITE);
plAll.setBounds(181, 0, 200, 392);
plAll.setLayout(null);
allChat.setMultipleMode(true);
allChat.setBounds(0, 22, 269, 495);
plAll.add(allChat);
JLabel label_1 = new JLabel("\u5168\u4F53\u6D88\u606F\u8BB0\u5F55");
label_1.setForeground(Color.DARK_GRAY);
label_1.setBackground(Color.WHITE);
label_1.setBounds(0, 1, 93, 22);
plAll.add(label_1);
sendAll.setBounds(0, 518, 269, 33);
sendAll.addActionListener(this);
sendAll.setActionCommand("all");
plAll.add(sendAll);
jframe.getContentPane().setLayout(null);
tabView(); // 选项卡布局
ListView(); // 好友列表布局
jframe.setSize(300, 633);
jframe.setVisible(true);
jframe.setResizable(false);
jframe.setDefaultCloseOperation(JFrame.DISPOSE_ON_CLOSE);
jframe.setTitle(user.getAccount());
// jframe.setLocationRelativeTo(jframe.getOwner());
jframe.setLocation(950, 50);
jframe.addWindowListener(new WindowListener() {
public void windowIconified(WindowEvent arg0) {
jframe.dispose();
}
@Override
public void windowActivated(WindowEvent e) {
// TODO 自动生成的方法存根
}
@Override
public void windowClosed(WindowEvent e) {
// TODO 自动生成的方法存根
}
@Override
public void windowClosing(WindowEvent e) {
// TODO 自动生成的方法存根
}
@Override
public void windowDeactivated(WindowEvent e) {
// TODO 自动生成的方法存根
}
@Override
public void windowDeiconified(WindowEvent e) {
// TODO 自动生成的方法存根
}
@Override
public void windowOpened(WindowEvent e) {
// TODO 自动生成的方法存根
}
});
this.mini();
}
// 选项卡布局
public void tabView() {
tab = new JTabbedPane(JTabbedPane.TOP);
tab.setForeground(Color.BLACK);
tab.setBackground(Color.WHITE);
tab.setBounds(10, 0, 274, 594);
Icon icon_chat = new ImageIcon("main_icon/main_icon_chat2.jpg");
Icon icon_all = new ImageIcon("main_icon/main_icon_all.jpg");
Icon icon_user = new ImageIcon("main_icon/main_icon_user.jpg");
Icon icon_search = new ImageIcon("main_icon/main_icon_search.jpg");
tab.addTab(" ", icon_chat, plUser_msg);
tab.addTab(" ", icon_all, plAll);
tab.addTab(" ", icon_user, plOne);
plSearch.setBackground(Color.WHITE);
tab.addTab(" ", icon_search, plSearch);
plSearch.setLayout(null);
plSearch.add(search);
JButton button = new JButton("查询");
button.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent arg0) {
if (!search.getText().equals("")) {
Search();
}
}
});
button.setBounds(203, 58, 66, 26);
plSearch.add(button);
JRadioButton radioButton = new JRadioButton("\u5E10\u6237");
radioButton.setSelected(true);
radioButton.setBackground(Color.WHITE);
radioButton.setBounds(0, 30, 49, 23);
plSearch.add(radioButton);
JRadioButton radioButton_1 = new JRadioButton("\u6635\u79F0");
radioButton_1.setBackground(Color.WHITE);
radioButton_1.setBounds(100, 30, 49, 23);
plSearch.add(radioButton_1);
JRadioButton radioButton_2 = new JRadioButton("\u7B7E\u540D");
radioButton_2.setBackground(Color.WHITE);
radioButton_2.setBounds(200, 32, 49, 23);
plSearch.add(radioButton_2);
search_list = new List();
search_list.setBounds(0, 92, 269, 473);
search_list.addActionListener(this);
plSearch.add(search_list);
tab.addChangeListener(new ChangeListener() {
@Override
public void stateChanged(ChangeEvent arg0) {
int index = tab.getSelectedIndex();
if (index == 0) {
tab.setTitleAt(0, " ");
} else if (index == 1) {
tab.setTitleAt(1, " ");
}
}
没有合适的资源?快使用搜索试试~ 我知道了~
资源推荐
资源详情
资源评论
收起资源包目录
java 即时聊天工具 (101个子文件)
Customer.class 16KB
ChatThread.class 12KB
ChatWindow.class 8KB
LoginView.class 7KB
LoginDao.class 6KB
Register.class 6KB
PersonInfo.class 5KB
Server.class 4KB
Bg.class 2KB
ReceiveFile.class 2KB
Register$3.class 2KB
ImageList.class 2KB
SendFile.class 2KB
BgWindow.class 2KB
Login.class 2KB
User.class 2KB
DBHelper.class 2KB
lokkand.class 2KB
User.class 1KB
LoginView$1.class 1KB
Friend.class 1KB
xuanxiangka.class 1KB
AllUser.class 1KB
Customer$4.class 1KB
Image_ing.class 1KB
Customer$1.class 1KB
Search.class 1KB
Main.class 1KB
outLineInfo.class 1KB
LoginView$2.class 1KB
Customer$2.class 923B
Customer$3.class 921B
InfoImage.class 896B
SetUser.class 831B
Main.class 752B
Register$1.class 739B
Register$2.class 739B
Customer$5.class 667B
Customer$7.class 662B
Customer$9.class 657B
Customer$8.class 657B
Customer$6.class 657B
Register.class 474B
Customer.java 17KB
ChatThread.java 12KB
ChatWindow.java 7KB
LoginView.java 6KB
LoginDao.java 6KB
Register.java 5KB
PersonInfo.java 4KB
Server.java 3KB
Bg.java 1KB
ReceiveFile.java 1KB
DBHelper.java 1KB
Login.java 1KB
User.java 1KB
ImageList.java 1KB
xuanxiangka.java 1KB
Image_ing.java 1KB
User.java 1001B
SendFile.java 957B
Friend.java 922B
AllUser.java 875B
Search.java 796B
BgWindow.java 765B
Main.java 704B
outLineInfo.java 655B
lokkand.java 625B
SetUser.java 379B
InfoImage.java 326B
Main.java 304B
Register.java 231B
main.jpg 161KB
main3.jpg 151KB
main4.jpg 112KB
main5.jpg 107KB
main2.jpg 100KB
main1.jpg 80KB
main_icon_all.jpg 76KB
pinfo5.jpg 53KB
main6.jpg 48KB
pinfo2.jpg 13KB
pinfo4.jpg 10KB
pinfo1.jpg 10KB
icon3.jpg 9KB
button1.jpg 8KB
main_icon_user1.jpg 8KB
pinfo3.jpg 7KB
icon5.jpg 3KB
icon4.jpg 3KB
icon2.jpg 2KB
icon1.jpg 2KB
main_icon_user.jpg 2KB
main_icon_search.jpg 2KB
main_icon_chat2.jpg 1KB
icon.jpg 444B
org.eclipse.jdt.core.prefs 629B
org.eclipse.jdt.core.prefs 629B
.project 390B
socket.sql 3KB
共 101 条
- 1
- 2
资源评论
Auspicious5
- 粉丝: 17
- 资源: 5
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功