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的网络通讯系统设计与实现(系统) https://blog.csdn.net/dearmite/article/details/131799642 2023年8月验证,无BUG 本系列校训 用免费公开视频,卷飞培训班哈人!打死不报班,赚钱靠狠干! 只要自己有电脑,前后项目都能搞!N年苦学无人问,一朝成名天下知! 互相伤害互相卷,玩命学习要你管,天生我才必有用,我命由我不由天! 喜欢的朋友还可以自己查到本站的N多毕业设计与课程设计, 如果错误或其它需要请留言!或发邮件至8195819@qq.com https://blog.csdn.net/dearmite/article/details/131799642 2023年8月验证,无BUG 本系列校训 用免费公开视频,卷飞培训班哈人!打死不报班,赚钱靠狠干! 只要自己有电脑,前后项目都能搞!N年苦学无人问,一朝成名天下知! 互相伤害互相卷,玩命学习要你管,天生我才必有用,我命由我不由天! 喜欢的朋友还可以自己查到本站的N多毕业设计与课程设计, 如果错误或其它需要请留言!或发邮件至8195819@qq.com
精选学习资源,大学生必学!
提供计算机相关教程、教材、习题、环境配置、实验报告、课程设计等精选内容
共1000+资源、文章
资源推荐
资源详情
资源评论














收起资源包目录





































































































共 228 条
- 1
- 2
- 3
资源评论

- #完美解决问题
- #运行顺畅
- #内容详尽
- #全网独家
- #注释完整

项目花园范德彪
- 粉丝: 8408
- 资源: 258
上传资源 快速赚钱
我的内容管理 展开
我的资源 快来上传第一个资源
我的收益
登录查看自己的收益我的积分 登录查看自己的积分
我的C币 登录后查看C币余额
我的收藏
我的下载
下载帮助


最新资源
- stm32的ucos资料
- CentOS7安装xtrabackup及依赖包:亲测可用
- MySql-and-Sql-Server-Script.zip
- DistributedCaching.zip
- 基于Three.js和Chart.js打造未来科技风AI监控仪表盘代码
- PPT文字格式批量处理工具.zip
- Qt数据库编程(SQLite API)
- 零基础学习Xmind 8软件.zip
- 食品集中化信息处理系统
- C语言->学生管理系统
- 商品销售商城-Python+Django
- 简约的域名主页HTML源码带暗黑模式.zip
- 嵌入式蓝桥杯第十五届真题练习
- 毛玻璃个人导航HTML源码.zip
- Python核心编程视频教程完结.zip
- Esp32-c6通过Mqtt实现与巴法云的数据传输和接收,完整数据交互
资源上传下载、课程学习等过程中有任何疑问或建议,欢迎提出宝贵意见哦~我们会及时处理!
点击此处反馈



安全验证
文档复制为VIP权益,开通VIP直接复制
