In two previous posts i demonstrated how to use openoffice from java (see Getting started using openoffice in java and Mailmerge MS-Word template using OpenOffice and Java). Here’s a small example illustrating how you can show and hide the document window.
When you’ve created an XComponent object for your document, you can get it’s window as follows, and hide and display it using the setVisible method:
XTextDocument xTextDocument = (XTextDocument) UnoRuntime
.queryInterface(XTextDocument.class, document);
xTextDocument.getCurrentController().getFrame().getContainerWindow()
.setVisible(true);
