//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();