frmEverbox.setJMenuBar(menuBar);
JMenu FileMenu = new JMenu("File");
menuBar.add(FileMenu);
JMenuItem ExitMenuItem = new JMenuItem("\u9000\u51FA");
ExitMenuItem.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent e) {
client.run = false;
stopClientButton.setText("正在关闭,请等候");
while(true) {
if(clientThread.isAlive())
try {
Thread.sleep(1000);
} catch (Throwable e1) {
}
break;
}
frmEverbox.dispose();
}
});
FileMenu.add(ExitMenuItem);
JMenu cleanMenu = new JMenu("\u6E05\u7406");
menuBar.add(cleanMenu);
JMenuItem mntmNewMenuItem = new JMenuItem("\u6E05\u7406\u767B\u9646\u4FE1\u606F");
mntmNewMenuItem.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent e) {
File f = new File("everbox.data");
if(f.exists())
f.delete();
}
});
mntmNewMenuItem.setEnabled(false);
cleanMenu.add(mntmNewMenuItem);
JMenuItem mntmNewMenuItem_1 = new JMenuItem("\u6E05\u7406\u65E5\u5FD7\u4FE1\u606F");
mntmNewMenuItem_1.setEnabled(false);
cleanMenu.add(mntmNewMenuItem_1);
JMenuItem mntmNewMenuItem_3 = new JMenuItem("\u6E05\u7406\u4E0B\u8F7D\u7528\u5230\u7684\u4E34\u65F6\u6587\u4EF6");
mntmNewMenuItem_3.setEnabled(false);
cleanMenu.add(mntmNewMenuItem_3);
JMenuItem mntmNewMenuItem_4 = new JMenuItem("\u6E05\u7406\u6587\u4EF6\u6570\u636E\u5E93");
mntmNewMenuItem_4.setEnabled(false);
cleanMenu.add(mntmNewMenuItem_4);
JMenu helpMenu = new JMenu("\u5E2E\u52A9");
menuBar.add(helpMenu);
JMenuItem vistHomepageMenuItem = new JMenuItem("\u8BBF\u95EE\u9879\u76EE\u9996\u9875");
vistHomepageMenuItem.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent e) {
try {
Desktop.getDesktop().browse(new URL("http://everbox4j.googlecode.com").toURI());
} catch (Throwable e2) {
log.warn("启动浏览器失败!!",e2);
JOptionPane.showConfirmDialog(frmEverbox, "启动浏览器失败!! http://everbox4j.googlecode.com");
}
}
});
helpMenu.add(vistHomepageMenuItem);
JMenuItem sendMailFeedback = new JMenuItem("\u610F\u89C1\u53CD\u9988(\u53D1\u9001\u90AE\u4EF6)");
sendMailFeedback.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent e) {
try {
Desktop.getDesktop().mail(new URL("everbox4j@wendal.net").toURI());
} catch (Throwable e2) {
log.warn("启动邮件客户端失败!!",e2);
JOptionPane.showConfirmDialog(frmEverbox, "启动邮件客户端失败!! 反馈邮箱: everbox4j@wendal.net");
}
}
});
helpMenu.add(sendMailFeedback);
JMenuItem aboutMenuItem = new JMenuItem("\u5173\u4E8E...");
aboutMenuItem.setEnabled(false);
helpMenu.add(aboutMenuItem);
JPanel clientContrlPanel = new JPanel();
frmEverbox.getContentPane().add(clientContrlPanel, BorderLayout.NORTH);