Focus to JTable perticular Cell

Hi all,

I have a problem like:

When first opens window , I load the data into table. I set the focus to first row of the table in the initialization method after loding the data.

But it doesn't focus to table.

//set the selection

table.setRowSelectionAllowed(false);

this.setFocus(table);

I tried with table.requestFocus() also

it doesn't work ...

can anyany know how to set the focus to perticular Cell in JTable.

I have 3 columns one is editable, the editable cell should be focused.

thanks

[569 byte] By [nim_ramesha] at [2007-10-2 8:41:01]
# 1

> But it doesn't focus to table.

You can't set focus to a component until it has been displayed in the GUI. Should your code should be something like:

frame.setVisible(true);

table.requestFocusInWindow();

> can anyany know how to set the focus to perticular Cell in JTable.

From the JTable API - changeSelection(...);

camickra at 2007-7-16 22:42:56 > top of Java-index,Desktop,Core GUI APIs...