A
Allan Valeriano
How can I find a specific node on a JTree, having the node's user
object? Is there a way to do that without searching the tree with a
loop?
In example:
Considering that I have a tree where every node has on its userObject,
a String, I need something like:
DefaultMutableTreeNode node = tree.getNode("ABC");
I know the method getNode(Object userObject) doesn't exist, but what
I'd like to know is if is there any other method that do something
like that for me...
I could search the entire tree looking on each node's userObject to
know if it is the node I want do deal with, but this would be veeeery
bad considering that the tree could get very long.
object? Is there a way to do that without searching the tree with a
loop?
In example:
Considering that I have a tree where every node has on its userObject,
a String, I need something like:
DefaultMutableTreeNode node = tree.getNode("ABC");
I know the method getNode(Object userObject) doesn't exist, but what
I'd like to know is if is there any other method that do something
like that for me...
I could search the entire tree looking on each node's userObject to
know if it is the node I want do deal with, but this would be veeeery
bad considering that the tree could get very long.