As you can see in the code above, a spreadsheet can be generated directly from data by using the static method createEmpty of the class SpreadSheet with a javax.swing.TableModel as an argument. The only thing to be specified is the file where to save the data.

You will find in the SpreadSheet class different methods that let you define the version of the final generated document with the appropriate extension:

- OpenOffice 1 (.sxc)

- ODF 1.0 & OpenOffice 2+ (.ods)

If you want to know more, look at the package org.jopendocument.dom.spreadsheet