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
没有合适的资源?快使用搜索试试~ 我知道了~
EQ.zip_java 企业
共42个文件
png:23个
java:9个
gif:4个
1.该资源内容由用户上传,如若侵权请联系客服进行举报
2.虚拟产品一经售出概不退款(资源遇到问题,请及时私信上传者)
2.虚拟产品一经售出概不退款(资源遇到问题,请及时私信上传者)
版权申诉
0 下载量 102 浏览量
2022-09-22
22:10:09
上传
评论
收藏 332KB ZIP 举报
温馨提示
方便企业内部通讯,避免企业内部信息外漏,企业员工之间可以相互通讯.120069567
资源推荐
资源详情
资源评论
收起资源包目录
EQ.zip (42个子文件)
企业内部通讯软件
readme.doc 236KB
EQ
res
image
telFrameImage
toolbarImage
ToolbarScene.png 1007B
ToolbarFace.png 988B
ToolbarPicture.png 816B
ToolbarFont.png 409B
telUserInfo.png 3KB
telUserImage.png 20KB
chexkBoxImg
CheckBoxTrue.png 1KB
CheckBoxFalse.png 676B
messageAlert.gif 256B
messageAlertNull20.gif 58B
tabIcon
tabLeft.PNG 4KB
tabLeft2.PNG 3KB
tabLeft3.png 4KB
messSendIcon
Success.gif 1KB
Fail.gif 590B
NEWFACE
11.png 5KB
10.png 5KB
5.png 6KB
9.png 5KB
1.png 5KB
6.png 5KB
2.png 6KB
7.png 5KB
4.png 5KB
8.png 5KB
3.png 5KB
icons
sysTray.png 4KB
.settings
org.eclipse.jdt.ui.prefs 99B
src
com
lzw
UpdateFrame.java 1KB
dao
Dao.java 6KB
frame
TelFrame.java 13KB
system
MessageFrame.java 2KB
Resource.java 7KB
EQ.java 30KB
userList
User.java 2KB
UserTreeRanderer.java 3KB
ChatTree.java 4KB
.project 498B
.fatjar 361B
.classpath 326B
.models 90B
共 42 条
- 1
资源评论
alvarocfc
- 粉丝: 109
- 资源: 1万+
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
最新资源
- 驱动代码驱动代码驱动代码驱动代码
- SVID_20240523_141155_1.mp4
- Code for the complete guide to tkinter tutorial
- 关于百货中心供应链管理系统.zip
- SimpleFolderIcon-master 修改Unity的Project下的文件夹图标
- A python Tkinter widget to display tile based maps
- A pure Python library for adding tables to a Tkinter application
- Vector资源文件.zip
- MobaXterm-Installer
- 88-520告白(520气球).zip
资源上传下载、课程学习等过程中有任何疑问或建议,欢迎提出宝贵意见哦~我们会及时处理!
点击此处反馈
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功