Node Updation in JTree
1 posts in topic
Flat View  Flat View
TOPIC ACTIONS:
 

Posted By:   Anonymous
Posted On:   Wednesday, January 30, 2008 06:19 PM

Hello everybody,


I have a problem in JTree.I can insert or remove nodes dynamically to tree.
Nodes are added or removed when i do the respective action,but when i close
the application and open it again,the inserted node is not seen.(i.e node is not updated).

Is there any method to update it?


Plz give the respective code for it.

Re: Node Updation in JTree

Posted By:   Stephen_McConnell  
Posted On:   Thursday, January 31, 2008 10:56 AM

Your application is a transient thing. When you close your app and open it up, all the "dynamic" changes you made are going to be gone....


What you CAN do is create some type of file that will save the state of your JTree. When you exit the program, you save this file and when you re-launch the program, you check to see if that file exists and then load it....building the JTree at that time.


You can delete the file or write over the file each time you exit the program.


The format of the file is up to you....


Stephen McConnell

About | Sitemap | Contact