![]() |
|
今天自己写个小程序碰到了这个问题,在网上搜了一下人家的思路,整理了一下代码可以运行,感觉不错!
直接在JBuilder中新建一个应用程序,至于具体步骤就不描述了,此代码没有main函数无法直接运行。下面我贴出在Frame1中的代码:
| import java.awt.*; import java.awt.event.*; import javax.swing.*; import com.borland.jbcl.layout.*; import java.util.Date; public class Frame1 //Construct the frame //Component initialization jPanel1.setLayout(xYLayout1); |
| //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); } } //具体实现按钮双击的功能的方法, 很简单的算法,不做解释了 if ( (nowTime - clickTime) < 300) { } void jList1_mouseReleased(MouseEvent e) { } class Frame1_jList1_mouseAdapter Frame1_jList1_mouseAdapter(Frame1 adaptee) { public void mouseReleased(MouseEvent e) { |