aspose file tools*
The moose likes Swing / AWT / SWT and the fly likes How to save a JTree content in a Text file and vise-versa Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Java 8 in Action this week in the Java 8 forum!
JavaRanch » Java Forums » Java » Swing / AWT / SWT
Reply locked New topic
Author

How to save a JTree content in a Text file and vise-versa

rohit singh Patel
Greenhorn

Joined: Feb 05, 2012
Posts: 4

Hi,

I'm new in java and for one project i need to create such application which could read data from a text file and when i exit from my app it should save change which we made in our Jtree.

We have completed the reading from text file thing (somehow) now i'm not able to save the Jtree back to text file.

Thanks
rohit singh Patel
Greenhorn

Joined: Feb 05, 2012
Posts: 4

Ranganathan Kaliyur Mannar
Bartender

Joined: Oct 16, 2003
Posts: 1075
    
  10

rohit singh Patel wrote:We have completed the reading from text file thing (somehow) now i'm not able to save the Jtree back to text file.

somehow, I get a feeling that you have not written this code or even read/understood this code. If you do that, you can easily save back the contents.

And I don't see any code which tries to save back the contents to the file. So, first, ShowSomeEffort, write code and try running that...and if it still doesn't work, get back to us with details...
You can go through this tutorial to understand JTree.


Ranga.
SCJP 1.4, OCMJEA/SCEA 5.0.
Ranganathan Kaliyur Mannar
Bartender

Joined: Oct 16, 2003
Posts: 1075
    
  10

ah...just found this out...
this post is a duplicate of this post 1 which itself is a duplicate of post 2.
I have already replied in the other post and you seem to have ignored that and created a new one. Which means I have simply wasted my time

Wanted to inform others before they waste their time...
Campbell Ritchie
Sheriff

Joined: Oct 13, 2005
Posts: 36563
    
  16
Thread locked. Thank you for noticing.
 
Don't get me started about those stupid light bulbs.
 
subject: How to save a JTree content in a Text file and vise-versa
 
Similar Threads
JTree
selecting a JTree node programmatically
JTree
JTree
JTree with CheckBox