Today, I wrote this short program, I have searched the ideas of people on the Internet, and the code can be run, it feels good! Built a new application directly in JBuilder, as for the specific steps, this code does not work directly.
Below I posted the code in Frame1: import java.awt. *; Import java.awt.event. *; Import javax.swing. *; Import com.borland.jbcl.layout. *; Import java.util.date ; public class Frame1 extends JFrame {JPanel contentPane; BorderLayout borderLayout1 = new BorderLayout (); JPanel jPanel1 = new JPanel (); XYLayout xYLayout1 = new XYLayout (); JScrollPane jScrollPane1 = new JScrollPane (); JList jList1 = new JList (); // Initialized data string [] strData = {"one", "tow", "three"}; // Save the click button Time = 0; // Construct the frame public frame1 () {enableevents (AWTEvent.WINDOW_EVENT_MASK); try {jbInit ();} catch (Exception e) {e.printStackTrace ();}} // Component initialization private void jbInit () throws Exception {contentPane = (JPanel) this.getContentPane (); contentPane.setLayout (borderLayout1); this.setSize (new Dimension (532, 468)); this.setTitle ( "Frame Title"); jPanel1.setLayout (xYLayout1); jList1.addMouseListener (new Frame1_jList1_mouseAdapter (this)); contentPane. Add (JPanel1, BorderLayout.center); JPANEL1.ADD ( jScrollPane1, new XYConstraints (18, 34, 209, 326));. jScrollPane1.getViewport () add (jList1, null); jList1.setListData (strData);} // 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);} // Specific method for the function of the button double-click the function, very simple algorithm Do not explain public boolean checkclicktime () {long nowtime = (new date ()). GetTime (); if ((NOWTIME - ClickTime) <300) {clicktime = nowtime; return true;} clicktime = nowtime; return False } void jlist1_mousereleased (mouseevent E) {// Judgment whether double click