package com.lzw;
import java.awt.BorderLayout;
import java.awt.Color;
import java.awt.Component;
import java.awt.Dialog;
import java.awt.Dimension;
import java.awt.FlowLayout;
import java.awt.Frame;
import java.awt.GridBagConstraints;
import java.awt.GridBagLayout;
import java.awt.GridLayout;
import java.awt.Image;
import java.awt.Insets;
import java.awt.MenuItem;
import java.awt.PopupMenu;
import java.awt.Rectangle;
import java.awt.SystemTray;
import java.awt.Toolkit;
import java.awt.TrayIcon;
import java.awt.TrayIcon.MessageType;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import java.awt.event.ComponentAdapter;
import java.awt.event.ComponentEvent;
import java.awt.event.KeyAdapter;
import java.awt.event.KeyEvent;
import java.awt.event.KeyListener;
import java.awt.event.MouseAdapter;
import java.awt.event.MouseEvent;
import java.awt.event.WindowAdapter;
import java.awt.event.WindowEvent;
import java.beans.PropertyChangeEvent;
import java.beans.VetoableChangeListener;
import java.io.File;
import java.io.FileInputStream;
import java.io.FileNotFoundException;
import java.io.FileOutputStream;
import java.io.IOException;
import java.net.DatagramPacket;
import java.net.DatagramSocket;
import java.net.InetAddress;
import java.net.SocketException;
import java.net.UnknownHostException;
import java.util.Date;
import java.util.Scanner;
import java.util.Stack;
import java.util.prefs.Preferences;
import javax.swing.BoxLayout;
import javax.swing.DefaultComboBoxModel;
import javax.swing.ImageIcon;
import javax.swing.JButton;
import javax.swing.JLabel;
import javax.swing.JList;
import javax.swing.JMenuItem;
import javax.swing.JOptionPane;
import javax.swing.JPanel;
import javax.swing.JPasswordField;
import javax.swing.JPopupMenu;
import javax.swing.JProgressBar;
import javax.swing.JScrollPane;
import javax.swing.JTabbedPane;
import javax.swing.JTextField;
import javax.swing.JToggleButton;
import javax.swing.ScrollPaneConstants;
import javax.swing.SwingConstants;
import javax.swing.UIManager;
import javax.swing.border.BevelBorder;
import javax.swing.border.EmptyBorder;
import javax.swing.border.TitledBorder;
import javax.swing.event.ChangeEvent;
import javax.swing.event.ChangeListener;
import javax.swing.text.InternationalFormatter;
import javax.swing.tree.DefaultMutableTreeNode;
import javax.swing.tree.DefaultTreeModel;
import javax.swing.tree.TreePath;
import com.lzw.dao.Dao;
import com.lzw.frame.TelFrame;
import com.lzw.system.Resource;
import com.lzw.userList.ChatTree;
import com.lzw.userList.User;
public class EQ extends Dialog {
private JTextField ipEndTField;
private JTextField ipStartTField;
private JTextField userNameTField;
private JPasswordField passwordTField;
private JTextField placardPathTField;
private JTextField updatePathTField;
private JTextField pubPathTField;
public static EQ frame = null;
private ChatTree chatTree;
private JPopupMenu popupMenu;
private JTabbedPane tabbedPane;
private JToggleButton searchUserButton;
private JProgressBar progressBar;
private JList faceList;
private JButton selectInterfaceOKButton;
private DatagramSocket ss;
private final JLabel stateLabel;
private static String user_dir;
private static File localFile;
private static File netFile;
private String netFilePath;
private JButton messageAlertButton;
private Stack<String> messageStack;
private ImageIcon messageAlertIcon;
private ImageIcon messageAlertNullIcon;
private Rectangle location;
public static TrayIcon trayicon;
private Dao dao;
public final static Preferences preferences = Preferences.systemRoot();;
private JButton userInfoButton;
public static void main(String args[]) {
try {
String laf = preferences.get("lookAndFeel", "java默认");
if (laf.indexOf("当前系统")>-1)
UIManager.setLookAndFeel(UIManager
.getSystemLookAndFeelClassName());
EQ frame = new EQ();
frame.setVisible(true);
frame.SystemTrayInitial();// 初始化系统栏
frame.server();
frame.checkPlacard();
} catch (Exception e) {
e.printStackTrace();
}
}
public EQ() {
super(new Frame());
frame = this;
dao = Dao.getDao();
location = dao.getLocation();
setTitle("EQ通讯");
setBounds(location);
progressBar = new JProgressBar();
progressBar.setBorder(new BevelBorder(BevelBorder.LOWERED));
tabbedPane = new JTabbedPane();
popupMenu = new JPopupMenu();
chatTree = new ChatTree(this);
user_dir = System.getProperty("user.dir"); // 程序执行路径用于系统更新
localFile = new File(user_dir + File.separator + "EQ.jar");// 本地EQ文件
stateLabel = new JLabel(); // 状态栏标签
addWindowListener(new FrameWindowListener());// 添加窗体监视器
addComponentListener(new ComponentAdapter() {
public void componentResized(final ComponentEvent e) {
saveLocation();
}
public void componentMoved(final ComponentEvent e) {
saveLocation();
}
});
try {// 启动通讯服务端口
ss = new DatagramSocket(1111);
} catch (SocketException e2) {
if (e2.getMessage().startsWith("Address already in use"))
showMessageDialog("服务端口被占用,或者本软件已经运行。");
System.exit(0);
}
{ // 初始化公共信息按钮
messageAlertIcon = new ImageIcon(EQ.class
.getResource("/image/messageAlert.gif"));
messageAlertNullIcon = new ImageIcon(EQ.class
.getResource("/image/messageAlertNull20.gif"));
messageStack = new Stack<String>();
messageAlertButton = new JButton();
messageAlertButton.setHorizontalAlignment(SwingConstants.RIGHT);
messageAlertButton.setContentAreaFilled(false);
final JPanel BannerPanel = new JPanel();
BannerPanel.setLayout(new BorderLayout());
add(BannerPanel, BorderLayout.NORTH);
userInfoButton = new JButton();
BannerPanel.add(userInfoButton, BorderLayout.WEST);
userInfoButton.setMargin(new Insets(0, 0, 0, 10));
initUserInfoButton();// 初始化本地用户头像按钮
BannerPanel.add(messageAlertButton, BorderLayout.CENTER);
messageAlertButton.addActionListener(new ActionListener() {
public void actionPerformed(final ActionEvent e) {
if (!messageStack.empty()) {
showMessageDialog(messageStack.pop());
}
}
});
messageAlertButton.setIcon(messageAlertIcon);
showMessageBar();
}
add(tabbedPane, BorderLayout.CENTER);
tabbedPane.setTabPlacement(SwingConstants.LEFT);
ImageIcon userTicon = new ImageIcon(EQ.class
.getResource("/image/tabIcon/tabLeft.PNG"));
tabbedPane.addTab(null, userTicon, createUserList(), "用户列表");
ImageIcon sysOTicon = new ImageIcon(EQ.class
.getResource("/image/tabIcon/tabLeft2.PNG"));
tabbedPane.addTab(null, sysOTicon, createSysToolPanel(), "系统操作");
ImageIcon sysSTicon = new ImageIcon(EQ.class
.getResource("/image/tabIcon/tabLeft3.png"));
tabbedPane.addTab(null, sysSTicon, createSysSetPanel(), "系统设置");
setAlwaysOnTop(true);
}
private JScrollPane createSysSetPanel() {
final JPanel sysSetPanel = new JPanel();
JScrollPane scrollPane = new JScrollPane(sysSetPanel);
sysSetPanel.setLayout(new BoxLayout(sysSetPanel, BoxLayout.Y_AXIS));
scrollPane.setBorder(new EmptyBorder(0, 0, 0, 0));
final JPanel sysPathPanel = new JPanel();
sysPathPanel.setMaximumSize(new Dimension(600, 200));
sysPathPanel.setBorder(new TitledBorder("系统路径"));
sysPathPanel.setLayout(new GridLayout(0, 1));
sysSetPanel.add(sysPathPanel);
sysPathPanel.add(new JLabel("程序升级路径:"));
updatePathTField = new JTextField(preferences
.get("updatePath", "请输入路径"));
sysPathPanel.add(updatePathTField);
sysPathPanel.add(new JLabel("系统公告路径:"));
placardPathTField = new JTextField(preferences.get("placardPath",
"请输入路径"));
sysPathPanel.add(placardPathTField);
sysPathPanel.add(new JLabel("公共程序路径:"));
pubPathTField = new JTex
没有合适的资源?快使用搜索试试~ 我知道了~
温馨提示
基于JAVA的网络通讯系统设计实现源码,主要针对计算机相关专业的正在做毕设的学生和需要项目实战练习的学习者,也可作为课程设计、期末大作业。 基于JAVA的网络通讯系统设计实现源码,主要针对计算机相关专业的正在做毕设的学生和需要项目实战练习的学习者,也可作为课程设计、期末大作业。 基于JAVA的网络通讯系统设计实现源码,主要针对计算机相关专业的正在做毕设的学生和需要项目实战练习的学习者,也可作为课程设计、期末大作业。 基于JAVA的网络通讯系统设计实现源码,主要针对计算机相关专业的正在做毕设的学生和需要项目实战练习的学习者,也可作为课程设计、期末大作业。
资源推荐
资源详情
资源评论
收起资源包目录
基于JAVA的网络通讯系统设计.zip (228个子文件)
EQ.bat 44B
EQ.class 22KB
TelFrame.class 14KB
Dao.class 8KB
Resource.class 6KB
ChatTree.class 6KB
UserTreeRanderer.class 4KB
Resource$1.class 3KB
User.class 3KB
Resource$1TheThread.class 3KB
ChatTree$1.class 3KB
MessageFrame.class 3KB
TelFrame$sendActionListener.class 3KB
TelFrame$MessageButtonActionListener.class 2KB
EQ$5.class 2KB
EQ$SysSetPanelOKListener.class 2KB
EQ$accessFolderActionListener.class 2KB
EQ$RenameActionListener.class 2KB
EQ$ChatTreeMouseListener.class 2KB
EQ$7.class 2KB
EQ$messagerGroupSendActionListener.class 2KB
UpdateFrame.class 2KB
EQ$8.class 1KB
EQ$SearchUserActionListener.class 1KB
EQ$4.class 1KB
EQ$SysUpdateListener.class 1KB
EQ$SearchUserActionListener$1.class 1KB
EQ$6.class 1KB
ChatTree$ThisMouseListener.class 1KB
EQ$AddUserActionListener.class 1KB
EQ$3.class 1KB
TelFrame$SendTextKeyListener.class 1KB
EQ$11.class 1KB
TelFrame$Button_1ActionListener.class 1KB
TelFrame$1.class 1KB
TelFrame$TelFrameClosing.class 1KB
EQ$2.class 872B
EQ$delUserActionListener.class 862B
TelFrame$toolbarActionListener.class 833B
EQ$10.class 786B
EQ$FrameWindowListener.class 739B
EQ$1.class 699B
EQ$SysTrayActionListener.class 691B
EQ$9.class 683B
.classpath 335B
log.ctrl 48B
logmirror.ctrl 48B
log.ctrl 48B
logmirror.ctrl 48B
log1.dat 1024KB
log1.dat 1024KB
c230.dat 84KB
c230.dat 84KB
c180.dat 24KB
c180.dat 24KB
ca1.dat 20KB
c20.dat 20KB
ca1.dat 20KB
c20.dat 20KB
c90.dat 16KB
c90.dat 16KB
c251.dat 12KB
c300.dat 12KB
c251.dat 12KB
c2a1.dat 8KB
c211.dat 8KB
c121.dat 8KB
c101.dat 8KB
c300.dat 8KB
c191.dat 8KB
c320.dat 8KB
c60.dat 8KB
c200.dat 8KB
c71.dat 8KB
c1e0.dat 8KB
c1d1.dat 8KB
c2e1.dat 8KB
cd1.dat 8KB
c1b1.dat 8KB
c171.dat 8KB
c141.dat 8KB
c2d0.dat 8KB
c1f1.dat 8KB
c290.dat 8KB
cf0.dat 8KB
c1c0.dat 8KB
c31.dat 8KB
cc0.dat 8KB
c1a1.dat 8KB
cb1.dat 8KB
c311.dat 8KB
c2f0.dat 8KB
c221.dat 8KB
c2c1.dat 8KB
c271.dat 8KB
c41.dat 8KB
c161.dat 8KB
c150.dat 8KB
c51.dat 8KB
c241.dat 8KB
共 228 条
- 1
- 2
- 3
资源评论
大雨淅淅
- 粉丝: 5154
- 资源: 347
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
最新资源
资源上传下载、课程学习等过程中有任何疑问或建议,欢迎提出宝贵意见哦~我们会及时处理!
点击此处反馈
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功