Skip to Main Content

Java SE (Java Platform, Standard Edition)

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Highlighting a specific node without selecting it in JTree

843805Dec 6 2006 — edited Dec 6 2006
I've got a JTree which is expanded. I can select a specific node outside of the tree via other mechanisms, and when I open it, I want that node to have highlighting. I have worked out the selection issues, so that I have a TreePath for the correct specific node, but I can't get that node to be highlighted when the tree is opened (it's in a JFrame if that matters).

In my case, each node is a part of the picture showing, and those parts can be selected, and then that info is passed to me, where I find the appropriate node in the tree - hence why I want it highlighted before anything is selected. Once it's open, other things can be selected. So, using JTree.setSelectionPath isn't working for me - it's actually selecting the node instead of just highlighting it.

Thank you.
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Jan 3 2007
Added on Dec 6 2006
1 comment
174 views