How can I find out which row in a JTable the user just clicked?
Try this:
aJTable.rowAtPoint(evt.getPoint());
If you only ever care about listening to selections on the JTable:
jTable.getSelectionModel().addListSelectionListener(new ListSelectionListener() { public void valueChanged(ListSelectionEvent e) { int sel = jTable.getSelectedRow(); } });
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With