• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

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

 
Greenhorn
Posts: 4
Oracle VI Editor Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
 
Ranch Hand
Posts: 4632
  • Likes 1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
you've obviously been reading about bold, how about you read up on listeners
 
Bartender
Posts: 1104
10
Netbeans IDE Java Ubuntu
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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.
 
Sheriff
Posts: 22787
131
Eclipse IDE Spring VI Editor Chrome Java Windows
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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.
 
Bartender
Posts: 5167
11
Netbeans IDE Opera Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
Posts: 22787
131
Eclipse IDE Spring VI Editor Chrome Java Windows
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Darryl means this thread which includes a code snippet.
 
Ranganathan Kaliyur Mannar
Bartender
Posts: 1104
10
Netbeans IDE Java Ubuntu
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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.
 
Don't get me started about those stupid light bulbs.
reply
    Bookmark Topic Watch Topic
  • New Topic