| Author |
JTree setFocus()
|
Chinmay Bajikar
Ranch Hand
Joined: Dec 08, 2001
Posts: 159
|
|
How do i setFocus() to a node in JTree?
|
The strength of the Wolf is the pack & the strength of the pack is the wolf....Rudyard Kipling
|
 |
Vinod Venugopal
Ranch Hand
Joined: Dec 06, 2000
Posts: 148
|
|
When you say "setFocus to a node" are you implying showing a node selected? In that case, you can do so by: 1) If you know the row no. you can write tree.setSelectionRow(rownumber) 2) If you know the node, then tree.setSelectionPath( new TreePath(node.getPath()) ); Then if you want to set focus to the tree pane then call pane.setFocus where pane is the container containing the tree. Vinod
|
- Vinod<br />-------<br />SCJP2
|
 |
 |
|
|
subject: JTree setFocus()
|
|
|