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
资源推荐
资源详情
资源评论
收起资源包目录
基于JAVA的网络通讯系统设计与实现(系统) (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
logmirror.ctrl 48B
log.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
c20.dat 20KB
ca1.dat 20KB
c90.dat 16KB
c90.dat 16KB
c251.dat 12KB
c300.dat 12KB
c251.dat 12KB
c320.dat 8KB
c200.dat 8KB
c2a1.dat 8KB
c1e0.dat 8KB
c211.dat 8KB
c300.dat 8KB
c171.dat 8KB
c71.dat 8KB
c191.dat 8KB
c290.dat 8KB
cd1.dat 8KB
c101.dat 8KB
c1d1.dat 8KB
c1f1.dat 8KB
c2e1.dat 8KB
c60.dat 8KB
c121.dat 8KB
c2d0.dat 8KB
c141.dat 8KB
c1a1.dat 8KB
c31.dat 8KB
cf0.dat 8KB
c2f0.dat 8KB
c311.dat 8KB
c2c1.dat 8KB
c221.dat 8KB
c150.dat 8KB
c1c0.dat 8KB
cc0.dat 8KB
c1b1.dat 8KB
c271.dat 8KB
cb1.dat 8KB
c51.dat 8KB
c241.dat 8KB
c41.dat 8KB
c161.dat 8KB
共 228 条
- 1
- 2
- 3
资源评论
项目花园范德彪
- 粉丝: 7511
- 资源: 219
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
最新资源
- MineAdmin是基于Hyperf框架 和 Vue3+Vite5 开发的前后端分离权限管理系统,自适应多终端 特色:后端 crud 生成 + 前端低代码 json 化配置.zip
- Preact前端框架,一键部署到云开发平台.zip
- bpi flash读ID程序
- Lessgo 是一款简单、稳定、高效、灵活的 golang web 开发框架,支持动态路由、自动化API测试文档、热编译、热更新等,实现前后端分离、系统与业务分离.zip
- 2019计算机联考408代码题
- easyink的前端服务之一,基于企业微信JS-SDK开发的企微客户端侧边栏页面.zip
- DRF-ADMIN后台管理系统项目(端代码).zip
- micro-app-chrome-plugin是基于京东零售推出的一款为micro-app框架而开发的chrome插件.zip
- front-end project template 前端快速开发模版.zip
- LaravelAdmin,简洁、直观、强悍的前端后端开发框架,让全栈开发更迅速的SPA单页面应用.LaravelAdmin,LaravelAdmin官网.zip
资源上传下载、课程学习等过程中有任何疑问或建议,欢迎提出宝贵意见哦~我们会及时处理!
点击此处反馈
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功