How to create a TreePath from a string and expand the Tree
Posted on 2001-06-09
I have a string like "switch 0 , Blade 1"
where switch 0 is parent , blade1 is child and so on.
This string is generated dynamically but it represents
a valid treepath.
I want to expand the tree to show this particular
treepath.I am not able to create a valid TreePath
from this string.
I did something like this:
1) tokenize the string
2) make an object array of the tokens.
3) Treepath tp = new TreePath(object array);
I get a "ClassCastException":java.lang.string