|
Java™ by example!
|
|
|
How do I detect a double-click on a row in a JTable?
Make sure your class implements the MouseListener interface, and use the following code to detect a double-click on a table row:
public void mouseClicked(MouseEvent e) { if (e.getClickCount() == 2) { JTable target = (JTable)e.getSource(); int row = target.getSelectedRow(); ... } } |
Further Information
Author of answer: Tom Scoggan
Comments to this answer are only viewable by members. Login or become a member!
|
|
|
|
|