Win a copy of Java 9 Modularity: Patterns and Practices for Developing Maintainable Applications this week in the Java 9 forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

How to create a xml file from a JTree  RSS feed

 
Vinoo Macmillan
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I have created a JTree which has methods allowing to add,delete or modify nodes.Basically ,the JTree tags are read from an XML file and then shown.Now,I want the modified JTree nodes to be saved to the XML file.Is there any way,I can create an XML file from the JTree?
I would be happy if someone could reply.
Thanks in advance.CHEERS.
 
Pavel Halas
Ranch Hand
Posts: 35
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Your problem arise because you're mixing data and gui.
Best way to do these data manipulations is to use Java best practice MVC scheme. It means Model-View-Controller.
Data (model) are strickly separated from gui (view), everything controled from one class (controller).
MVC
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!