File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
Win a copy of Clojure in Action this week in the Clojure forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Changes which we made in JTree are not reflecting in our file

 
rohit singh Patel
Greenhorn
Posts: 4
Java Oracle VI Editor
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Friends,
I'm a newbie in Java and we are creating one application where we fetch the data from the file and created the tree structure (JTree) and we are able to change the data in JTree but the changes which we made in JTree are not reflecting in our file. Please help me out with this how to push back the data to the same file with changes we made in JTree.
Thanks
Rohit Singh
 
Michael Dunn
Ranch Hand
Posts: 4632
  • 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
you've obviously been reading about bold, how about you read up on listeners
 
Ranganathan Kaliyur Mannar
Bartender
Posts: 1101
10
Java Netbeans IDE Ubuntu
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Rohit,
Welcome to the Ranch!

Please read about How To Ask Questions. And also remember to Keep It Down.
Please go through the links to understand how to pose questions.

Also, though your question is related to trees, the issue that this thread topic deals with is different. Asking a different question in someone's else thread is not considered polite and is known as thread hijacking. Please start a new topic with your question to get answers.
 
Rob Spoor
Sheriff
Pie
Posts: 20381
46
Chrome Eclipse IDE Java Windows
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Rohit, please don't use bold tags or colouring in regular text. Also, if you keep the right case in class names, our forum software will often create an automatic link to the Javadoc page for that class. Compare JTREE (no link) versus JTree (link).
Also, Java is not an acronym so it shouldn't be written in all upper case letters.
 
Darryl Burke
Bartender
Posts: 5115
11
Java Netbeans IDE Opera
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
rohit, please continue this discussion here. I've locked the second thread you started with the same question.
 
Rob Spoor
Sheriff
Pie
Posts: 20381
46
Chrome Eclipse IDE Java Windows
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Darryl means this thread which includes a code snippet.
 
Ranganathan Kaliyur Mannar
Bartender
Posts: 1101
10
Java Netbeans IDE Ubuntu
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You have used some logic to build the tree. Use the same logic to read the tree and write to the file. This 'save' operation can be done from a button or menuitem.

If you need to actively listen and write to the file then & there, you need to write a TreeModelListener to listen to instant changes. This tutorial can help you in that.
 
I agree. Here's the link: http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic