Goutham
Goutham

Reputation: 2859

Java Tree Node selection

I have a tree and a TreePath to one of its nodes. How do I programatically select this node? Will setSelectionPath of the JTree object alone work?

Upvotes: 0

Views: 867

Answers (1)

Varun
Varun

Reputation: 1004

Yes. From the Java Documentation

If any component of the path is hidden (under a collapsed node), and getExpandsSelectedPaths is true it is exposed (made viewable).

Upvotes: 2

Related Questions