//Overridden so we can exit when window is closed protected void processWindowEvent(WindowEvent e) { super.processWindowEvent(e); if (e.getID() == WindowEvent.WINDOW_CLOSING) { System.exit(0); } } //具體實現按鈕雙擊的功能的方法, 很簡單的算法,不做解釋了 public boolean checkClickTime() { long nowTime = (new Date()).getTime();