updateDateLabel.setText(dateStr);
final GridBagConstraints updateDateLayout = new GridBagConstraints();
updateDateLayout.gridy = 2;
updateDateLayout.gridx = 0;
sysUpdatePanel.add(updateDateLabel, updateDateLayout);
final JLabel updateStaticLabel = new JLabel("更新状态:");
final GridBagConstraints updateStaticLayout = new GridBagConstraints();
updateStaticLayout.gridy = 3;
updateStaticLayout.gridx = 0;
sysUpdatePanel.add(updateStaticLabel, updateStaticLayout);
final JLabel updateInfoLabel = new JLabel();// 版本信息标签
checkSysInfo(updateInfoLabel);// 调用检测版本更新的方法
final GridBagConstraints gridBagConstraints_5 = new GridBagConstraints();
gridBagConstraints_5.gridy = 4;
gridBagConstraints_5.gridx = 0;
sysUpdatePanel.add(updateInfoLabel, gridBagConstraints_5);
JPanel statePanel = new JPanel();
add(statePanel, BorderLayout.SOUTH);
statePanel.setLayout(new BorderLayout());
statePanel.add(stateLabel);
stateLabel.setText("总人数:" + chatTree.getRowCount());
return sysToolScrollPanel;
}
//----------------------------------------------------------------------------------
private void initUserInfoButton(){
try{
String ip = InetAddress.getLocalHost().getHostAddress();
User user = dao.getUser(ip);
userInfoButton.setIcon(user.getIconImg());
userInfoButton.setText(user.getName());
userInfoButton.setIconTextGap(JLabel.RIGHT);
userInfoButton.setToolTipText(user.getTipText());
userInfoButton.getParent().doLayout();
}catch(UnknownHostException e1){
e1.printStackTrace();
}
}
//----------------------------------------------------------------------------------
private void showMessageBar(){// 显示公告信息按钮的线程
new Thread(new Runnable() {
public void run() {
while (true) {
if (!messageStack.empty()) {
try {
messageAlertButton.setIcon(messageAlertNullIcon);
messageAlertButton.setPreferredSize(new Dimension(20, 20));
Thread.sleep(500);
messageAlertButton.setIcon(messageAlertIcon);
Thread.sleep(500);
} catch (InterruptedException e) {
e.printStackTrace();
}
} else {
try {
Thread.sleep(3000);
} catch (InterruptedException e) {
e.printStackTrace();
}
}
}
}
}).start();
}
//----------------------------------------------------------------------------------
private void checkSysInfo(final JLabel updateInfo){
new Thread(new Runnable(){
public void run(){
String info = "";
while(true){
try{
netFilePath = preferences.get("updatePath", "EQ.jar");
if(netFilePath.equals("EQ.jar")){
info = "<html>
未设置升级路径