1

I have a made a TreeTableView in javafx. The program gets an file and after processing the data gives a treetable.Now I want to save this TreeTableView in a file, so that i can open it without doing the process. What is the best way to serialize this object(treetableview)? Is it possible to murshall it into xml?

Iman
  • 769
  • 1
  • 13
  • 51

1 Answers1

1

As far as I know there is no "standardized" way to serialize a TreeTableView since it is only a graphical representation of data. The overhead of saving all the settings you made to the graphical JavaFX Objects would be way too much overhead. But you can walk the tree manually using a recursive function and serialize the data yourself (either by the standard serialization of java if your template class is serializable or by creating your own serialization format (which would again save you some overhead)).

omgBob
  • 527
  • 3
  • 9
  • how about exporting the treetableview to excel file? is it possible? – Iman Mar 10 '15 at 12:21
  • I haven't done it yet, but a solution has been found for tables: http://stackoverflow.com/questions/17273806/printing-importing-and-exporting-data-inside-tableview-in-javafx What would you expect the tree look to be like in excel? – omgBob Mar 10 '15 at 12:27
  • the treetable looks http://stackoverflow.com/questions/28963660/setting-the-value-of-parent-according-to-its-children-for-each-column-in-treetab – Iman Mar 10 '15 at 12:35
  • I can not show it here in comments somehow. But i have asked another question regarding to my problem. The Tree has parent and child and I need to print it or save to excel. – Iman Mar 10 '15 at 12:39