public static void main(String args[]) {
        /*
         * Set the Nimbus look and feel
         */
        //<editor-fold defaultstate="collapsed" desc=" Look and feel setting code (optional) ">
        /*
         * If Nimbus (introduced in Java SE 6) is not available, stay with the
         * default look and feel. For details see
         * http://download.oracle.com/javase/tutorial/uiswing/lookandfeel/plaf.html
         */
//        Font f = new Font("Tahoma", Font.PLAIN, 11);
//        UIManager.put("TextField.font", f);
//        UIManager.put("Label.font", f);
//        UIManager.put("ComboBox.font", f);
//        UIManager.put("MenuBar.font", f);
//        UIManager.put("Menu.font", f);
//        UIManager.put("ToolTip.font", f);
//        UIManager.put("MenuItem.font", f);

        try {
            for (javax.swing.UIManager.LookAndFeelInfo info : javax.swing.UIManager.getInstalledLookAndFeels()) {
                if ("Nimbus".equals(info.getName())) {
                    javax.swing.UIManager.setLookAndFeel(info.getClassName());
                    break;
                }
            }
            //设置界面风格为windows风格
            UIManager.setLookAndFeel("com.sun.java.swing.plaf.windows.WindowsLookAndFeel");
        } catch (ClassNotFoundException ex) {
            java.util.logging.Logger.getLogger(MainFrame.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
        } catch (InstantiationException ex) {
            java.util.logging.Logger.getLogger(MainFrame.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
        } catch (IllegalAccessException ex) {
            java.util.logging.Logger.getLogger(MainFrame.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
        } catch (javax.swing.UnsupportedLookAndFeelException ex) {
            java.util.logging.Logger.getLogger(MainFrame.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
        }
        //</editor-fold>

        /*
         * Create and display the form
         */
        java.awt.EventQueue.invokeLater(new Runnable() {
            
            public void run() {
                final MainFrame mainFrame = new MainFrame();
                mainFrame.setIconImage(Toolkit.getDefaultToolkit().createImage(getClass().getResource("/org/kaoqin/ui/tree-bug.png")));
                mainFrame.setVisible(true);
                mainFrame.setTitle(Configer.Const.VERSION);
                mainFrame.setLocation(350, 80);
                //设置当点击右上角关闭按钮最小化，不退出程序
                mainFrame.setDefaultCloseOperation(JFrame.DO_NOTHING_ON_CLOSE);
                mainFrame.addWindowListener(new WindowAdapter() {
                    public void windowClosing(WindowEvent e) {
                        mainFrame.setVisible(false);
                    }
                });
                KqLoger.setMainFrame(mainFrame);
                loadConfigToUI(mainFrame);//加载配置信息到界面
                if (SystemTray.isSupported()) // 判断系统是否支持系统托盘
		{
			mainFrame.initTray();
		}

            }
            /**
             *  加载配置信息到界面
             */
            public void loadConfigToUI(MainFrame mainFrame){
                try {
                    //系统配置
                    mainFrame.sbTime.setText(Configer.getProportyIgnor("sbTime"));
                    mainFrame.xbTime.setText(Configer.getProportyIgnor("xbTime"));
                    mainFrame.kaoqinServerHost.setText(Configer.getProportyIgnor("kaoqinServerHost"));
                    mainFrame.proxy.setText(Configer.getProportyIgnor("proxy"));
                    mainFrame.port.setValue(Integer.parseInt(Configer.getProportyIgnor("port")));
                    mainFrame.checkInterval.setValue(Integer.parseInt(Configer.getProportyIgnor("checkInterval")));
                    mainFrame.proxyEnable.setSelected(Boolean.parseBoolean(Configer.getProportyIgnor("proxyEnable")));
                    
                    mainFrame.modifyIP.setSelected(Boolean.parseBoolean(Configer.getProportyIgnor("modifyIP")));
                    mainFrame.localIP.setText(Configer.getProportyIgnor("localIP"));
                    mainFrame.mask.setText(Configer.getProportyIgnor("mask"));
                    mainFrame.gateWay.setText(Configer.getProportyIgnor("gateWay"));
                    mainFrame.adapterName.setText(Configer.getProportyIgnor("adapterName"));
                    //用户配置
                    List<User> userlist= Configer.getAllUser();
                    DefaultTableModel tableModel = (DefaultTableModel)  mainFrame.usersTable.getModel();
                    for(int i=0;i<userlist.size();i++){
                        User user=userlist.get(i);
                        tableModel.addRow(new String[]{user.getUsername(),user.getPassword(),user.getYzm(),user.getYgyzm(),user.getIp(),user.getMacaddress(),user.getSeriousnumber()});
                    }
                   
                } catch (Exception e) {
                    JOptionPane.showMessageDialog(null, e.getMessage(), "加载配置信息异常", JOptionPane.ERROR_MESSAGE);
                }
            }
        });
    }