Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

JTree Help

Posted on 2004-09-02
8
Medium Priority
?
312 Views
Last Modified: 2010-03-31
I would to cascade a tree Node using JTree like below.


Root(r)+
|                                    1.c]
|                                 1.b]
|-------------------[Node1.a]
|
|                                    2.c]
|                                   2.b]
|______________[Node 2.a]
|
|
|
|


When Node 1.b has got focus and selected the tree structure will be


Root(r)+
|                                    1.c]
|                                 1.a]
|-------------------[Node1.b]
|
|                                    2.c]
|                                   2.b]
|______________[Node 2.a]
|
|
|
|


How could  i do using JTree Component?
0
Comment
Question by:ammachiyar
6 Comments
 
LVL 92

Accepted Solution

by:
objects earned 100 total points
ID: 11970637
If I follow you correctly you would need to change the structure of the tree whenever a node is selected.
can you explain more about what u are trying to achieve?
0
 
LVL 18

Expert Comment

by:armoghan
ID: 11970640
You are just swaping the two nodes?
0
 
LVL 6

Assisted Solution

by:expertmb
expertmb earned 100 total points
ID: 11970641
0
What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

 
LVL 18

Assisted Solution

by:armoghan
armoghan earned 100 total points
ID: 11970643
get to the path of the Tree nodes using TreePath and swap the userObject of the two nodes
0
 
LVL 12

Assisted Solution

by:Giant2
Giant2 earned 100 total points
ID: 11970693
>get to the path of the Tree nodes using TreePath and swap the userObject of the two nodes

...and fire the action to the Tree
0
 
LVL 35

Assisted Solution

by:girionis
girionis earned 100 total points
ID: 11970761
Just changing the name of the node would be fine (I think).
0

Featured Post

New feature and membership benefit!

New feature! Upgrade and increase expert visibility of your issues with Priority Questions.

Question has a verified solution.

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

Java contains several comparison operators (e.g., <, <=, >, >=, ==, !=) that allow you to compare primitive values. However, these operators cannot be used to compare the contents of objects. Interface Comparable is used to allow objects of a cl…
Basic understanding on "OO- Object Orientation" is needed for designing a logical solution to solve a problem. Basic OOAD is a prerequisite for a coder to ensure that they follow the basic design of OO. This would help developers to understand the b…
This theoretical tutorial explains exceptions, reasons for exceptions, different categories of exception and exception hierarchy.
This video teaches viewers about errors in exception handling.
Suggested Courses

772 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