Solved

JTree Help

Posted on 2004-09-02
8
265 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
8 Comments
 
LVL 92

Accepted Solution

by:
objects earned 25 total points
Comment Utility
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
Comment Utility
You are just swaping the two nodes?
0
 
LVL 6

Assisted Solution

by:expertmb
expertmb earned 25 total points
Comment Utility
0
IT, Stop Being Called Into Every Meeting

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

 
LVL 18

Assisted Solution

by:armoghan
armoghan earned 25 total points
Comment Utility
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 25 total points
Comment Utility
>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 25 total points
Comment Utility
Just changing the name of the node would be fine (I think).
0

Featured Post

What Security Threats Are You Missing?

Enhance your security with threat intelligence from the web. Get trending threat insights on hackers, exploits, and suspicious IP addresses delivered to your inbox with our free Cyber Daily.

Join & Write a Comment

Suggested Solutions

Title # Comments Views Activity
bunnyEars challenge 6 62
solarwind tftp server 2 29
micro services vs rest web services 16 44
github account with ecipse 1 14
For customizing the look of your lightweight component and making it look lucid like it was made of glass. Or: how to make your component more Apple-ish ;) This tip assumes your component to be of rectangular shape and completely opaque. (COD…
Are you developing a Java application and want to create Excel Spreadsheets? You have come to the right place, this article will describe how you can create Excel Spreadsheets from a Java Application. For the purposes of this article, I will be u…
Viewers will learn about basic arrays, how to declare them, and how to use them. Introduction and definition: Declare an array and cover the syntax of declaring them: Initialize every index in the created array: Example/Features of a basic arr…
The viewer will learn how to implement Singleton Design Pattern in Java.

728 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

Need Help in Real-Time?

Connect with top rated Experts

11 Experts available now in Live!

Get 1:1 Help Now