set selection on specific node of JTree

hi guys,

i have JTree and i just want to set the selection (give the selection) to the node X by press JButton, where X is one of my tree nodes.

the following link is sample for JTree if any one need it in his explanation.

http://www.java2s.com/Code/Java/Swing-JFC/SimpleSwingtreeTreescanbevastlymorecomplex.htm

by the way i used TreeNodeSelection, setSelectionPath, addSelectionPath but nothing worked :(

thanks

[449 byte] By [aalroubaiea] at [2007-11-26 14:22:05]
# 1
hii found it :))the problem was using updateUI after set my selection.
aalroubaiea at 2007-7-8 2:14:02 > top of Java-index,Java Essentials,Java Programming...