File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes Swing / AWT / SWT and the fly likes JTree Refresh Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Swing / AWT / SWT
Bookmark "JTree Refresh" Watch "JTree Refresh" New topic

JTree Refresh

BillyBob Smith

Joined: May 24, 2001
Posts: 3
My JTree is generated by a database query and also fire's events to run other querys but the database changes the values which affect my tree so I have to rebuild it periodically but I have a problem with if a node it selected and I rebuild the tree the tree resets to the state where all nodes are collasped and none selected.....
If Someone has some example code or any help for me ...

I have got the tree path i want to reset it to stores in a var but I cant make it set the selection
Thanks BillyBob
Carlos Cuevas

Joined: Sep 26, 2002
Posts: 9
Whoops, this might jut be too late, but i just stteped into your query today, but anyways, here�s what I�ve acomplished when trying to solve the same thing... might work for someone

I agree. Here's the link:
subject: JTree Refresh
It's not a secret anymore!