I want to export a XML
file from a JTable
. Also I want to Export HTML
file From the same JTable
Thanks ,
I want to export a XML
file from a JTable
. Also I want to Export HTML
file From the same JTable
Thanks ,
You question lacks enough detail to do anything more than outline a simple approach. The data viewed by a JTable
is stored in it's TableModel
. Suppose your model looks like the one shown here.
private Map<String, String> data = System.getenv();
You can write an XML representation to stdout
like this
Map<String, String> data = System.getenv();
XMLEncoder e = new XMLEncoder(new BufferedOutputStream(System.out));
e.writeObject(data);
e.close();
The XMLEncoder
API shows how to write to a file. Conversely, XMLDecoder
maybe used to reverse the process. See Long Term Persistence of JavaBeans Components: XML Schema for more.