tags:

views:

2556

answers:

3

I want to find out at whih row of JTable the user clicked.

How to do it ?

+5  A: 
JTable.rowAtPoint(evt.getPoint());
Paul Tomblin
+1  A: 

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();
    }
});
oxbow_lakes
Does this still work if it's in column or cell selection mode?
Paul Tomblin
A: 

Great Solution - I just loved this. Thanks A lot -Bhanu

Bhanu