Hi everyone,
This might have been asked before but I've scoured the forums and i'm still unsure about how to create an xml representation of a jtree object.
The following code doesn't do the trick:
XMLEncoder xml = null;
JTree loaded = tree1;
try {
xml = new XMLEncoder( new BufferedOutputStream(
new FileOutputStream("Test.xml")));
}
catch (FileNotFoundException e1) {
e1.printStackTrace();
}
xml.writeObject(loaded);
xml.flush();
xml.close();
}
I assume a jtree cannot be so simply represented in xml but could someone explain how it can be done and what steps I need to take in order to achieve this?
Thanks.