Using the OOoBean

From Apache OpenOffice Wiki
Jump to: navigation, search



The Java class OOoBean can be instantiated directly, or application classes can be derived from this class. If a real Java Bean is to be created, which for example can be used in Java Bean UI builders, it has to be subclassed. The application class then might use the UNO bootstrapping mechanism to find the OOoBean, Apache OpenOffice and its API classes. This mechanism is not built into OOoBean itself because it can not be used to find itself. And once the OOoBean class has been found, you intrinsically also find the Apache OpenOffice installation and the API classes.

A standard Apache OpenOffice is a prerequisite. The Apache OpenOffice executable, as well as the UNO libraries and runtime, is found using the Java Class Loader. Moving or copying the needed class files will not result in a working OOoBean.

Documentation caution.png Since the Office Bean uses a native peer to render Apache OpenOffice documents, Swing components, such as drop-down menus or list boxes appear behind it, or they are not displayed at all. One way to avoid this is by exclusively employing AWT components when using the Office Bean. Another, but only partial, solution is to tell Java Swing to create heavy weight windows for popup menus: JPopupMenu.setDefaultLightWeightPopupEnabled.
Documentation caution.png Currently the Office Bean is not available for Mac (see issue 54172 for more details).
Content on this page is licensed under the Public Documentation License (PDL).
Personal tools
In other languages