|
-
Apr 10th, 2003, 04:53 AM
#1
Thread Starter
Addicted Member
JTree, Model, TreeNodes etc... HELP
Hello
I have been using the DeafultMutableTreeNode and build an Array LIst with my various bits of information, this displays fine, but when i add an element to my Array LIst i can't seem to get the tree to update properly. Some one suggested i shold write my own MVC aprach for it.
I was wondering if someone could possibly explain which parts i would need to implement to achieve the desired tree.
The tree heirarchy, as i said earlier is an ArrayList of Array List, i think thats straight forward enough, now when i add a new element to one of these arraylists anywhere indise of my heirarchy array list i want to the tree to update automatically...
does that make sense?!
I guess the question is, what do i have to implement to get this to work for me, the Tree Model, the TreeNode or something else?!
Cheers in advance
Andy
-
Apr 10th, 2003, 10:04 AM
#2
Dazed Member
I guess you would need to call public void validate() on the container to ask it to layout its sub-components again.
-
Apr 10th, 2003, 10:08 AM
#3
Thread Starter
Addicted Member
ah thank you
i have sorted my problem now, and foudn the problem was with a JScrollPane rather than the way i was repopulatig my tree.
Does anyone know why adding a JTree straight to a JScrollPane caused refresh problem, but adding the JTree to a JPanel and then to the JScrollPane solved it..
bizarre
Cheers again
Andy
-
Apr 29th, 2003, 07:55 PM
#4
Addicted Member
I dunno about that, but i think there is an update() method in the TreeModel class... dunno if it actually works tho... :-D
To protect time is to protect everything...
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|