Saving swing to a file

I have a program whose output is a JTree. I want to be able to save that tree in a file for later viewing. I dont mind if this is done by saving it as a Jpeg or if it saves the data and rewrites the JTree each time it is loaded. The JPEG is the prefered option.

Any ideas how to do this?

Bow_wow.

[322 byte] By [bow_wow] at [2007-9-26 18:25:42]
# 1

> I have a program whose output is a JTree. I want to be

> able to save that tree in a file for later viewing. I

> dont mind if this is done by saving it as a Jpeg or if

> it saves the data and rewrites the JTree each time it

> is loaded. The JPEG is the prefered option.

>

> Any ideas how to do this?

>

> Bow_wow.

How about saving the tree as an xml file. The xml file can be view with internet explorer. you can start by writing a class that extends org.jdom.output.XMLOutputter

Try researhing JDom

Hope that helps

jonesbond0017 at 2007-7-3 2:36:49 > top of Java-index,Archived Forums,Java Programming...
# 2
OK thanks, I'll look into it.
bow_wow at 2007-7-3 2:36:49 > top of Java-index,Archived Forums,Java Programming...