Using swing jTable (named resultTbl), I want to have double click select the current row. The canonical suggestion is essentially to add a mouse listener
pointing toresultTbl.addMouseListener(new java.awt.event.MouseAdapter() { public void mouseClicked(java.awt.event.MouseEvent evt) { resultTblMouseClicked(evt); } });
Much trial (both with and without the evt.consume() line and lots of printlns) has proven to me that this code sees one mouse click but never a second one. What can I do to get the second click?private void resultTblMouseClicked(java.awt.event.MouseEvent evt) { if (evt.getClickCount() == 2 && !evt.isConsumed()) { evt.consume(); /* perform select action */ } }
Thanks!