473,385 Members | 1,331 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,385 software developers and data experts.

JTree

I've been working with a JTree based on a custom TreeModel.
Unfortunatly, I cant figure out how to force it to update the entire
tree-- there simply dosnt seem to be a way to say "OK, your data changed
so drastically, it's not even worth me telling you where to start".

I have tried the fireTreeStructureChanged event, but that only updates
the tree structure, leaving nodes that have changed only by name
unchanged and me cursing. I've also tried firing multiple events;
combinations of StructureChanged, and NodeChanged, and _almsot_ got what
I wanted.

Could someone give me an overview of what I need to do eventwise to
update the entire tree?

Jul 17 '05 #1
2 4146

"Mitch Williams" <co************@cox.net> wrote in message
news:9Drbb.3084$Rd4.805@fed1read07...
I've been working with a JTree based on a custom TreeModel.
Unfortunatly, I cant figure out how to force it to update the entire
tree-- there simply dosnt seem to be a way to say "OK, your data changed
so drastically, it's not even worth me telling you where to start".

I have tried the fireTreeStructureChanged event, but that only updates
the tree structure, leaving nodes that have changed only by name
unchanged and me cursing. I've also tried firing multiple events;
combinations of StructureChanged, and NodeChanged, and _almsot_ got what
I wanted.

Could someone give me an overview of what I need to do eventwise to
update the entire tree?


How about if you set the data model for the JTree to null, then re-set it to
the new, changed data model?

Chris
Jul 17 '05 #2
Chris Esposito wrote:
"Mitch Williams" <co************@cox.net> wrote in message
news:9Drbb.3084$Rd4.805@fed1read07...
I've been working with a JTree based on a custom TreeModel.
Unfortunatly, I cant figure out how to force it to update the entire
tree-- there simply dosnt seem to be a way to say "OK, your data changed
so drastically, it's not even worth me telling you where to start".

I have tried the fireTreeStructureChanged event, but that only updates
the tree structure, leaving nodes that have changed only by name
unchanged and me cursing. I've also tried firing multiple events;
combinations of StructureChanged, and NodeChanged, and _almsot_ got what
I wanted.

Could someone give me an overview of what I need to do eventwise to
update the entire tree?

How about if you set the data model for the JTree to null, then re-set it to
the new, changed data model?

Chris

Dosn't appear to work; I'd like to steer clear of recreating the
component itself, because I know it can be done without going to that
extreme.

thanks tho.

Jul 17 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: Bernard Koninckx | last post by:
Hello everybody, I'vee a small problem with a JTree. I make an expand from a node. And after this operation the selection is lost. How can I do reselect the node than I come expand ? Thanks...
2
by: Piet | last post by:
Hi there, I have managed to write a small java program that display an xml file in a JTree. This was achieved by defining a suitable tree model. THe program works...somehow. The nodes (elements...
0
by: Lucia | last post by:
hello, I habe a Java Program that displays the XML document in a Java JTree using DOM. Now I can add, delete and edit the JTree Elements. But I don't know how to show the attributes also in the...
0
by: luvping04 | last post by:
Hey, i told to make a java program to load xml into JTREE using SAX api. i'm suppose to load the 1st layer of the jtree and hide the subtree into memory. How can i load the subtree into...
0
by: flavourofbru | last post by:
Hi, I am converting a given html document into a tree structure and displaying it using JTree and DefaultMutable classes. By using the html parser and the JTree functionality, I can display the...
1
by: flavourofbru | last post by:
Hi, I am presently trying to display an XML document as a tree structure. I am able to do it using JTree and SAX Parser. Now I would like to get the parents of all non-leaf nodes and display...
2
by: msali36 | last post by:
Hi, i just want to know how can i display the parent- child information in hirarchy tree format in vb.net. for example : GrantParent parent ...
2
by: ace84 | last post by:
Hi, I am creating an application where I want to show a file system. I have never worked with them before, so i am not sure on what I need to do to accomplish my goal. So far I found a script through...
1
by: sivakrish85 | last post by:
Hi, this is krishna i am on developing FTP in java.Here i display the server Files and client Files in tree view using JTree.So my question is that once the client send the file to...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.