How to set Focus to the first row in a JTable which is inside a JScrollPane
Joined: Jul 06, 2012
I have a JTable inside a JScrollPane. I have put this inside a panel. As soon the panel loads i want the first row in the JTable to get the focus BUT by default the focus goes to the JScrollPane and on pressing tab the focus enters into table's first row.
I dont want to use setRowSelectionInterval(0,0) and setColumnSelectionInterval(0,0) as my requirement is different from that. Kindly help me. Thanks.