OpenSwing is composed of a client-side library and a serverside library. You can use only one of these files or use both libraries. The client-side library is based on file clientos.jar. The server side library is based on the file serveros.jar.
The following files must be also available to use OpenSwing framework:
- jcalendar.jar (an open source library (LGPL) for viewing a calendar, written by Kai Toedter)
- poi-2.0-RC2-20040102.jar (an open source library used to generate Excel files)
- itext-1.4.8.jar (an open source library used to generate PDF or RTF files)
Moreover, these files can be useful to start a client-side application from Java Web Start:
- jnlp.jar (JNLP API provided by Sun)
- jnlp-servlet.jar (JNLP Servlet provided by Sun)
The following file can be used to log server-side messages though Log4J:
- log4j-1.2.7.jar
The following file can be used to manage a pool of database connections:
- pooler.jar (based on Java DB Conn Pool opensource library)
These files contains OpenSwing sources that can be useful to include in the IDE to debug OpenSwing classes:
- srcclientos.jar
- srcserveros.jar
Note: hsqldb.jar is only used in demos included with the OpenSwing distribution, so that it is not part of OpenSwing framework.
- beaninfo.jar - library that can be installed inside an IDE that supports Java Beans specifications (JBuilder, NetBeans, JDeveloper)
Finally, beaninfo.jar file can included in the IDE to create a components palette; this facilitates UI components creation, by using the UI designer of the IDE. Currently three IDEs have been tested with OpenSwing components and are full compatibile with UI designing: NetBeans 4.1/5.x/6 b1, JBuilder 8/9/X/2005/2006, JDeveloper 10.1.x and Eclipse 3.x (using Window Builder plugin or Jigloo plugin).
Optionally, you can include additional libraries, used by ClientUtils.getImage() method and by TreePanel and ImagePanel components to support additional image formats, such as .tif, .ico, .bmp, .pcx/.pic, .png. These libraries are:
- JAI, a free library released from Sun that allows to read BMP, TIF and PNG image formats
- JIMI, a free library released from Sun that allows to read ICO, TIF, BMP, PIC/PCX, PNG image formats
In the following section it will be described how including OpenSwing components (aka beanifo.jar file) as a palette in the IDE.
To create a palette of components in JBuilder:
To create a palette of components in NetBeans:
It is recomended to change default behavior of NetBeans 6 when dropping a grid control within the UI designer: as default behavior NetBeans presets a not desirable layout for grid control just added. To avoid this automatic layout settings, go to "Tools" -> "Options" menu of NetBeans and select "Miscellaneous" button, press "Advanced options" button and select "GUI Builder" node; in the panel at the right change "Layout Generation Style" to "Standard Java 6 Code". This setting is valid for all forms to create.
For an already existing form, switch to design mode, select the root node of the form and right click with the mouse, select "Properties" and finally change "Layout Generation Style" to "Standard Java 6 Code".
To create a palette of components in JDeveloper you must first define a library:
To define the palette:
Eclipse's Visual Editor is not able to correctly render all OpenSwing graphics controls, because of it does not fully support Java Beans specifications.
You can use Eclipse and OpenSwing only if you include an Eclipse plugin that fully support Java Beans specifications.
A good (non free) plugin for Eclipse 3.x is Window Builder - Swing Designer
Another plugin for Eclipse 3.x is Jigloo, that it is distributed in dual licence: free for non commercial use and a commercial use licence.
When creating a project inside Eclipse, you have to include OpenSwing library to the project; to do that you should:
After doing these steps, you can include the library just created to the specified project:
Apart that, you have to include OpenSwing "beaninfo.jar" file to the Eclispe palette; this operation depends on the UI designer (Eclipse plugin) you decided to use, such as Window Builder or Jigloo, as described below.
Window Builder
After installing "Window Builder - Swing Designer" (see Swing Designer installation instructions), you can create JFrame, JPanel and many other Swing components by:
At this point "Swing Designer" plugin will open the class with two alternative views: "Source" and "Design".
When switching to "Design" view, it is available a Component Palette.
Inside this Component Palette it is possible to include all OpenSwing components, through the following steps:
Note: if OpenSwing components are not visible inside the new category, close Eclipse and restart it.
Jigloo plugin
After installing "Jigloo" (see Jigloo plugin installation instructions), you can create JFrame, JPanel and many other Swing components by:
At this point "Jigloo" plugin will open the class with two alternative views: GUI/Java editors.
When GUI editor is visible, it is available a Component Palette.
Inside this Component Palette it is possible to include all OpenSwing components, through the following steps: