?
Solved

How to create a TreePath from a string and expand the Tree

Posted on 2001-06-09
3
Medium Priority
?
568 Views
Last Modified: 2012-08-13
Hi,
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);
4) Tree.expandpath(Treepath)

I get a "ClassCastException":java.lang.string

any suggestions?





0
Comment
Question by:sanjay_thakur
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
3 Comments
 
LVL 3

Accepted Solution

by:
superschlonz earned 300 total points
ID: 6171907
I think you have to search the TreeNodes by name and then create
the treepath with these treenodes.
0
 
LVL 9

Expert Comment

by:Ovi
ID: 6186074
post your code
0
 
LVL 92

Expert Comment

by:objects
ID: 6305630
superschlonz is correct.
You need to create your tree path from an array of tree nodes.
0

Featured Post

VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

INTRODUCTION Working with files is a moderately common task in Java.  For most projects hard coding the file names, using parameters in configuration files, or using command-line arguments is sufficient.   However, when your application has vi…
Introduction This article is the first of three articles that explain why and how the Experts Exchange QA Team does test automation for our web site. This article explains our test automation goals. Then rationale is given for the tools we use to a…
Viewers learn about the third conditional statement “else if” and use it in an example program. Then additional information about conditional statements is provided, covering the topic thoroughly. Viewers learn about the third conditional statement …
Viewers learn how to read error messages and identify possible mistakes that could cause hours of frustration. Coding is as much about debugging your code as it is about writing it. Define Error Message: Line Numbers: Type of Error: Break Down…
Suggested Courses
Course of the Month11 days, 23 hours left to enroll

752 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question