tags:

views:

25

answers:

1

I have created a JTable where the included items are provided with radio buttons in order to enable users to select any of these once at a time. In order to show always the first item selected when the JTable is initialised (or when the item previously selected has been deleted) what method should I use?

+1  A: 

You should see the JTable Javadoc and particularly at :

getCellRect(int row, int column, boolean includeSpacing)

and

scrollRectToVisible(Rectangle aRect)

Something like

table.scrollRectToVisible(table.getCellRect(table.getSelectedRows()[0], 0, true));

should suit you.

S0pra