I am working on customizing a closed source client application. It has a tree in the UI and exposed only a method to get the selected node. It returns a subclass of TreeNode. And there is no way to get a reference to the parent tree. Now i want to expand the selected node upto its leaves.
Is there any way to get a reference to the JTree component from a DefaultMutableTreeNode? I am planning to use the JTree.expandPath() but I only have the reference to the treenode.
I'm new to Swing and any suggestions to achieve this are welcome.