Highlighting a specific node without selecting it in JTree
843805Dec 6 2006 — edited Dec 6 2006I'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.