Accessing ODF files through the OO Java API and using the data in GUI elements are separate activities. You'll need to dig into the API to figure out how to access the data that you need for the GUI. The AccessingFileFormats wiki page links to a number of articles about the OO Java API and the ODF file format.
OpenOffice can read a number of file formats, and makes them accessible through its API. A starting point might be this article and of course the OO developer site
Some introductory information about the OO file format can be found here and here - basic Java code for reading OO files is here
Reading an OpenOffice file is not as simple as reading a plain text file, simply because OpenOffice contains a lot more features than a plain text editor. [ October 31, 2007: Message edited by: Jesper Young ]
Either use the OO Java API to convert the file to some other format that you do know how to open, or -based on the articles linked above- write code that opens and processes the files.
From my cursory look at the articles OO files appear to be zipped-up XML files. Since Java has APIs for dealing with ZIP and XML files, getting at the actual contents shouldn't be too hard. Making sense of those is a different matter, of course - I'd recommend to start with a simple document, to see if you can manage to extract whatever information you need.
You need a loop. ZipInputStream.getNextEntry() returns null when there are no more entries, so you can use that as the loop controller. If you only want to output certain files, then you need to check the name of each ZipEntry object before you write it out. Check the API docs to see if there is a method that gets the name of the ZipEntry object.
There is a piece of software called JODConverter that can open any file that OpenOffice can open and export to any that OpenOffice can export to. I am happy to say that it has really helped me solve the issues.
PS: It is FOSS
You showed up just in time for the waffles! And this tiny ad:
Building a Better World in your Backyard by Paul Wheaton and Shawn Klassen-Koop