OpenSwing Components

Installation instructions

OpenSwing is composed of a client-side libraries and a serverside libraries. You can use some of these files or use all of them. The client-side libraries are based on files commonos.jar and clientos.jar. The server side libraries are based on files commonos.jar and 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 using java 1.4 or above)
- itext-2.1.7.jar (an open source library used to generate PDF or RTF files using java 1.5 or above)
- itext-rtf-2.1.7.jar (an open source library used to generate PDF or RTF files using java 1.5 or above)

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:
- srccommonos.jar
- 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).

IMPORTANT NOTE: do not include beaninfo.jar as project library: it has only to be included into IDE settings, in order to show the OpenSwing components palette within the IDE.

IMPORTANT NOTE: in order to use QueryUtil class, an implementation of Servlet API must be provided: for instance servlet-api.jar file (from tomcat/lib folder) can be included as project library .

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.

 

Installing OpenSwing components palette in JBuilder

To create a palette of components in JBuilder:

  • select "Tools" from menu bar
  • select "Configure Palette" and press "Add" button to define a new palette
  • select new defined palette and go to the "Add Components" folder
  • press "Select Library" button and configure a new library by pressing "New" button
  • in "New library" wizard add the beaninfo.jar and close that window
  • press "Add from selected library" and close all windows
Now the OpenSwing palette will be visible.
Note: sometimes in JBuilder this procedure must be repeated twice because of a bug in some versions of JBuilder.



Installing OpenSwing components palette in NetBeans

To create a palette of components in NetBeans:

  • Create a library definition for the OpenSwing components palette:
    • select "Tools | Library | New Library" from menu bar
    • set the library name (e.g. 'OpenSwingPalette') and click OK
    • when the newly created library is selected, click 'Add Jar/Folder'
    • select BeanInfo.jar, jnlp.jar, jcalendar.jar, clientos.jar, serveros.jar and commonos.jar files (under the 'build' directory in openswing installation) and click 'Add jar/folder'
    • close the library manager.
  • Install Openswing components palette:
    • select 'Tools | Palette | Swing/AWT Components' from menu bar to open the Palette manager
    • create a new category via 'New Category' button
    • select the newly created category and select 'Add From Library'
    • select 'OpenSwingPalette' library and click Next
    • select all the available components and click Next
    • select 'OpenSwing' category , click Finish and close the palette manager.
  • Create a library definition for the components:
    • select "Tools | Library | New Library" from menu bar
    • set the library name (e.g. 'OpenSwing') and click OK
    • when the newly created library is selected, click 'Add Jar/Folder'
    • select all the openswing jar files (under the 'build' directory in openswing installation, except BeanInfo.jar file) and click 'Add jar/folder'
    • close the library manager.
  • Add the 'OpenSwing' library to a java application project. (Right-click on Libraries node and select 'Add Library').



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".

Import note: you have installed OpenSwing in the past and want to update the version of OpenSwing components palette, it is recommended to remote the internal cache of NetBeans, i.e. clear up the content of folder yourhomedir\.netbeans\6.9\var\cache folder and restart NetBeans; after that, follow the instructions reported above in order to define the OpenSwingPalette and OpenSwing libraries and components palette.

 

Installing OpenSwing components palette in JDeveloper 10.1.2

To create a palette of components in JDeveloper you must first define a library:

  • select "Tools" from menu bar
  • select "Manage Libraries" and select "User libraries" node and press "New" button to define a new library
  • set a name for the new library
  • define the classpath by pressing "Edit" button to select the beaninfo.jar file
  • press ok to close all windows

To define the palette:

  • select "Tools" from menu bar
  • select "Configure Palette" and press "Add" button on the left to define a new palette
  • select new defined palette and press "Add" button on the right to add a library
  • select the library just created and select the filter "Java Beans with BeanInfo only"
  • select all filters classes and add them
Now the OpenSwing palette will be visible.
Note: maybe component images could be not visible; in that case you have to select images from beaninfo.jar, for each image not viewed.



Installing OpenSwing components palette in Eclipse 3.x or WebSphere Studio IDEs

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:

  • select " Window" from menu bar -> "Preferences" -> "Java" -> "Build Path" -> "User Libraries"
  • press "New" button to create a libreary: name it for instance "OpenSwing"
  • press "Add JARs" to add all OpenSwing libraries (included in "build" folder of OpenSwing distribution)

After doing these steps, you can include the library just created to the specified project:

  • select "Project" from menu bar -> "Properties" -> "Java Build Path" -> "Libraries"
  • press "Add Library" button and select the library created above
 

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:

  • selecting "File" from menu bar
  • selecting "New" -> "Other" menu items
  • expanding "Designer" -> "Swing" folders
  • selecting a Swing components, e.g. JFrame and creating a class

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:

  • click with the right mouse button inside the Palette
  • select "Palette Manager" in the popup menu just Viewed
  • press "Add Category" button and specify a category name, such as "OpenSwing" and press "Ok" button
  • select the category just created and press "Add from Archive" button
  • in the "Archive" input field specify the absolute path to the "lib/BeanInfo.jar" file included in the OpenSwing distribution and press ENTER
  • when the "Select All" button becomes enabled, press it and press "Ok" button to confirm all OpenSwing components
  • finally press "Ok": at this point the OpenSwing palette will be visible in the Component Palette

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:

  • selecting "File" from menu bar
  • selecting "New" -> "Other" menu items
  • expanding "Designer" -> "Swing" folders
  • selecting a Swing components, e.g. JFrame and creating a class

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:

  • select "Window" -> "Preferences" from Eclipse menu bar
  • expand "Jigloo GUI Builder" node in the menu tree
  • select "Component Palette/Custom classes"
  • press "Add (bean or palette)" button to specify a new components folder, such as "OpenSwing": press "Ok" and select it
  • press "Add Beans from Archive " button: this will open a jar file selection window
  • choose "Beaninfo.jar" file included with OpenSwing distribution and press "Ok" button
  • press "Ok" to confirm new components inclusion: at this point the OpenSwing palette will be visible in the Component Palette

 

 

Licence | Contacts | ©2007 Mauro Carniel SourceForge.net Logo