OpenSwing Framework

# OpenSwing Components

SourceForge.net Home page JAllinOne More documentation

Inserisci i termini di ricerca Invia modulo di ricerca

### Samples

OpenSwing provides some examples that show how to use the framework with alternative application architectures.

Most of these demos use an Hypersonic Database to read/write data, included in the OpenSwing distribution. The database is automatically populated by the demo.
To execute a demo you have to download the zip OpenSwing distribution: in "classes" folder are available .bat/.sh starting files. Demo source files are located in "src/demo*" forders.

The following schema reports a description of the demos provided with OpenSwing.

Example | Description
Demo1 | This is a stand-alone application, based on MDI front-end, where there is not any user authentication and application menu items are fixed. It shows a splash screen too.

Demo2

This is a two tier client-server application, based on MDI front-end, where presentation tier and business logic + data access tiers are embedded in the same program. However, presentation layer and business logic/data access layers are decoupled, bacause of the OpenSwing classes organization that insure distinct tasks between front-end e underlying tiers, encouraging in this way a riuse of business logic or presentation logic in other points of the application or of other applications.

In this sample user authentication is enabled. Use “admin/admin” account to log in.

Moreover, the application has a multi-language support; it supports two languages: english and italian and internationalization settings of these two languages are stored in XML files.

In this demo two examples of windows are reported: an internal frame that contains a grid (in read only mode) and a detail internal frame, accessible through double click on the selected row on the grid.

Demo3

This is a two tier client-server application, based on SDI front-end, where presentation tier and business logic + data access tiers are embedded in the same program. However, presentation layer and business logic/data access layers are decoupled, bacause of the OpenSwing classes organization that insure distinct tasks between front-end e underlying tiers, encouraging in this way a riuse of business logic or presentation logic in other points of the application or of other applications.

In this sample user authentication is not supported and windows are based on Swing JFrame class.

Moreover, the application supports one only language (english) and and internationalization settings are defined through EnglishOnlyResourceFactory OpenSwing class.

In this demo an example of window is reported: a frame that contains a grid that supports insertion and editing of cells. There is also a locked row anchored to the bottom of grid, to show how to anchor rows and fill in and color them and setting font per cell.

Grid frame contains a FormattedTextColumn that shows how to use this kind of column combined with a MaskFormatter class.

Demo4

This is a two tier client-server application, based on SDI front-end, where presentation tier and business logic + data access tiers are embedded in the same program. However, presentation layer and business logic/data access layers are decoupled, bacause of the OpenSwing classes organization that insure distinct tasks between front-end e underlying tiers, encouraging in this way a riuse of business logic or presentation logic in other points of the application or of other applications.

In this sample user authentication is not supported and windows are based on Swing JFrame class.

Moreover, the application supports one only language (english) and and internationalization settings are defined through EnglishOnlyResourceFactory OpenSwing class.

In this demo two examples of windows are reported: a frame that contains a grid in read only mode and a detail frame, accessible through double click on the selected row on the grid. Data for grid is retrieved by using QueryUtil class. Column sorting is performed without contacting the database: sorting is delegated directly to the grid control.

Detail frame is linked to its parent grid, so that selecting a row into the grid through the navigator bar will reload all detail windows and navigating through the navigator bar of the detail window will reload its content and also will select the related row in the grid. Moreover, inserting data in the Form will update grid content too and updating data in the Form will update grid content too and deleting Form content will remove the related row in the grid.

Detail frame contains a FormattedTextControl that shows how to use this kind of control combined with a MaskFormatter class.

Form's controller contains a "validateControl" method used to define if editing values setted in input controls are valid.

Detail frame contains a FormattedTextControl that shows how to use this kind of control combined with a MaskFormatter class. It contains a PasswordControl too.

Detail frame contains a lookup control where the “onInvalidCode” property has been setted to “LookupController.ON_INVALID_CODE_RESTORE_LAST_VALID_CODE”, i.e. when the user digit an incorrect code in the code field, the lookup automatically restore within the code field the last valid code digited by the user in the past or already present in the lookup when loadind the form.

Demo5

This is a three tier client-server web application, based on MDI front-end, activable as Java Applet through a a web page in the browser or as java application through Java Web Start. The presentation tier is executed on the client, wgile business logic + data access tiers are executed in the server-side application, inside an Application Server. Presentation layer and business logic/data access layers are decoupled and comunite each other via HTTP protocol by means of the utility class ClientUtils.

In this sample user authentication is enabled. Use “admin/admin” account to log in.

Moreover, the application has a multi-language support; it supports two languages: english and italian and internationalization settings of these two languages are stored in XML files that can be accessed both on client and on the server-side.

In this demo two examples of windows are reported: an internal frame that contains a grid (in read only mode) and a detail internal frame, accessible through double click on the selected row on the grid.

The detail frame reports an example of lookup graphics control.

To execute this demo you have to copy the war file located in “classes/demo5/demo5.war” inside an application server, such as Tomcat, inside “webapps” Tomcat folder and start it. After that, open your browser and connect to http://tomcathost:tomcatport/demo5/ and click on demo5.jsp or demo5.jnlp to execute the application.

In last release of this application, the hessian-3.1.1.jar library has been added; as consequence, this demo can be executed only with Java 1.5 or above: thanks to this open source library, it will be possible to combine
different versions of java for client and server sides for the application.

Demo6

This is a two tier client-server application, based on SDI front-end, where presentation tier and business logic + data access tiers are embedded in the same program. However, presentation layer and business logic/data access layers are decoupled, bacause of the OpenSwing classes organization that insure distinct tasks between front-end e underlying tiers, encouraging in this way a riuse of business logic or presentation logic in other points of the application or of other applications.

In this sample user authentication is not supported and windows are based on Swing JFrame class.

Moreover, the application supports one only language (english) and and internationalization settings are defined through EnglishOnlyResourceFactory OpenSwing class.

In this demo two examples of windows are reported: a frame that contains a grid in read only mode and a detail frame, accessible through double click on the selected row on the grid.

The detail frame reports an example of lookup graphics control with lookup button that opens a tree window.

This sample shows also how to use ListFilterController abstract class, in order to show in quick filter panel a check box list control, that can be used to select more than one value per time in a fast way.

Demo7

This is a two tier client-server application, based on SDI front-end, where presentation tier and business logic + data access tiers are embedded in the same program. However, presentation layer and business logic/data access layers are decoupled, bacause of the OpenSwing classes organization that insure distinct tasks between front-end e underlying tiers, encouraging in this way a riuse of business logic or presentation logic in other points of the application or of other applications.

In this sample user authentication is not supported and windows are based on Swing JFrame class.

Moreover, the application supports one only language (english) and and internationalization settings are defined through EnglishOnlyResourceFactory OpenSwing class.

In this demo two examples of windows are reported: a frame that contains a grid in read only mode and a detail frame, accessible through double click on the selected row on the grid.

The grid frame uses cells coloration.

The detail frame reports an example of lookup graphics control with lookup button that opens a tree+grid window.

Demo8 | This is a stand-alone application, based on MDI front-end, where there is not any user authentication and application menu items are fixed. This example contains an internal frame showing a Gantt diagram.

Demo9

This is a two tier client-server application, based on SDI front-end, where presentation tier and business logic + data access tiers are embedded in the same program. However, presentation layer and business logic/data access layers are decoupled, bacause of the OpenSwing classes organization that insure distinct tasks between front-end e underlying tiers, encouraging in this way a riuse of business logic or presentation logic in other points of the application or of other applications.

In this sample user authentication is not supported and windows are based on Swing JFrame class.

Moreover, the application supports one only language (english) and and internationalization settings are defined through EnglishOnlyResourceFactory OpenSwing class.

In this demo an example of window is reported: a frame that contains a grid that supports multiple insertion rows and editing of cells.

Demo10

This is a two tier client-server application, based on MDI front-end, where presentation tier and business logic + data access tiers are embedded in the same program. However, presentation layer and business logic/data access layers are decoupled, bacause of the OpenSwing classes organization that insure distinct tasks between front-end e underlying tiers, encouraging in this way a riuse of business logic or presentation logic in other points of the application or of other applications.

In this sample user authentication is not supported.

Moreover, the application support one only language (english) and and internationalization settings are defined through EnglishOnlyResourceFactory OpenSwing class.

In this demo several examples of windows are reported: a frame that contains a list of employees in read only mode and an employee detail frame, accessible through double click on the selected row on the grid. Moreover a frame that contains two editable grids in master/detail configuration is provided: employess list + working days per employee.

Business logic layer is based on object to database mapping, entirely realized using QueryUtil utility class that simplify ORM mapping and filtering/sorting settings application to base SQL.

In this demo is also showed the tip of the day window.

This demo adopts JGoodies look ‘n feel.

This demo also shows how to activate grid profile management based on file system storage.

Lookups included in employee detail frame and in employees editable grid frame have auto completition feature enabled.

The frame that contains employee detail Form + grid of working days also contains an export button used to export in a unique documento both detail Form data and grid data.

The frame that contains employees grid + grid of working days per employee also contains an export button used to export in a unique documento both detail Form data and grid data.

Demo11

This is a stand-alone application, based on SDI front-end, where presentation tier and business logic + data access tiers are embedded in the same program.

Application supports one only language (english) and and internationalization settings are defined through EnglishOnlyResourceFactory OpenSwing class.

In this demo an example of window is reported: a frame that contains a tree+grid frame, where grid rows are grouped through tree nodes: i.e. the Tree+Grid panel contains a TreeModel whose nodes are value objects and a specific v.o. attribute is linked to each node and the others attributes are mapped to grid columns. This data organization can be useful to aggregate information in functionalities like bill of materials.

Tree+Grid component is similar to TreeTable component described in Creating TreeTables in Swing but based on a TreeTableModel that contains value objects, so more easy to use.

Demo12

This is a stand-alone application, based on SDI front-end, where presentation tier and business logic + data access tiers are embedded in the same program.
Application supports one only language (english) and and internationalization settings are defined through EnglishOnlyResourceFactory OpenSwing class.
In this demo an example of window is reported: a frame that contains a tree component; user can drag ‘n drop nodes inside the tree, to move or copy nodes. Node description renaming is allowed too. Background and foreground nodes colors are setted too.

Demo13 | This sample is the same sample reported in demo10, but created as a project inside NetBeans 4.1. It demonstrates the OpenSwing features when combined with NetBeans.
Demo14 | This sample shows how to use the wizard panel to create a wizard frame. It also show how to include a licence agreement panel and a progress bar panel.
Demo15 | This sample shows how to use an image control inside a Form panel.
Demo16 | This sample shows how to use an image column inside a grid control to insert, update and delete images.
Demo17 | This sample shows how to use Hibernate as ORM layer, in order to create frames having grids and Form panel; the sample shows how fetching data by reading the whole result set or a block of data, how embedding filtering and sorting settings in the query and how insert/update/delete starting from the value object. Inner value objects are also used to fill in grid and Forms and lookups.

Demo18

This sample is a three tier application having a front-end based on OpenSwing graphics components and a server-side layer based on the Spring framework. HTTP protocol is used to communicate from client to server layer.
In last release of this application, the hessian-3.1.1.jar library has been added; as consequence, this demo can be executed only with Java 1.5 or above: thanks to this open source library, it will be possible to combine
different versions of java for client and server sides for the application.

Demo19

This sample is a two tiered client-server application having a front-end based on OpenSwing graphics components and a server-side layer based on iBatis Data Mapper, release 2.3. This sample shows how to apply filtering and sorting conditions of a grid control in value objects mapped in iBatis, how to setup a pagination policy for grid and how insert, update, delete value objects through iBatis.

This sample shows also how define grid columns and graphics controls having an attribute defined by composing inner value objects.

Demo20 | This is a two tier client-server application, based on SDI front-end, where presentation tier and business logic + data access tiers are embedded in the same program. This application shows a grid control having additional column headers.
Demo21 | This is a two tier client-server application, based on SDI front-end, where presentation tier and business logic + data access tiers are embedded in the same program. This application shows a property grid control, where properties are manually defined: for each one there is an input control created.
Demo22 | This is a two tier client-server application, based on SDI front-end, where presentation tier and business logic + data access tiers are embedded in the same program. This application shows a property grid control, where properties are automatically defined starting from a value object.
Demo23 | This application shows the use of a MultipleTypeColumn inside a grid: it creates a frame containing a grid control. The grid control has two columns: a property name column and a property value column. The latter allows to define values having several types, defined through the TypeController class.
Demo24 | This application shows the use of a the cells span inside a Grid control. Grid control contains a lookup column where the “onInvalidCode” property has been setted to “LookupController. ON_INVALID_CODE_RESTORE_FOCUS”, i.e. when the user digit an incorrect code in the code field, the lookup automatically does restore focus within the code cell to force the user to correct it; saving operation is not permitted until the code is invalid.
Demo25 | This application shows the use a progress bar column in a Grid control and a progress bar control inside a Form detailed panel.
Demo26 | This application shows the use the ComboBoxVOControl and the ListVOControl in a detail form.
Demo27 | This application shows the use the ComboBoxVOColumn in an editable grid control.

Demo28

This is a two tier client-server application, based on MDI front-end, where presentation tier and business logic + data access tiers are embedded in the same program. However, presentation layer and business logic/data access layers are decoupled, bacause of the OpenSwing classes organization that insure distinct tasks between front-end e underlying tiers, encouraging in this way a riuse of business logic or presentation logic in other points of the application or of other applications.

This demo shows grid profile management based on database tables and JGoodies look 'n feel.

Demo29

This is a two tier client-server application, based on MDI front-end, where presentation tier and business logic + data access tiers are embedded in the same program. However, presentation layer and business logic/data access layers are decoupled, bacause of the OpenSwing classes organization that insure distinct tasks between front-end e underlying tiers, encouraging in this way a riuse of business logic or presentation logic in other points of the application or of other applications.
In this sample user authentication is not supported.
Moreover, the application support one only language (english) and and internationalization settings are defined through EnglishOnlyResourceFactory OpenSwing class.

In this demo two examples of windows are reported: grid frames (for departments and tasks) and a frame that contains both the employees grid (in read only mode) and an employee detail Form; grid and Form are linked together, i.e. when selecting a tow in grid the Form will automatically reload it and when using the Form's navigator bar the selected row on grid changes. In the same frame is also added another grid, that is dependent on the Form: when loading form this grid reload itself too.

Demo30 | This is a stand-alone application, based on SDI front-end, where presentation tier and business logic + data access tiers are embedded in the same program. In this demo there is a grid and a detail frame. Detail frame shows a list control having multiple selection mode setted, that allows to store multiple selected values in the detail panel.

Demo31

This is a stand-alone application, based on SDI front-end, where presentation tier and business logic + data access tiers are embedded in the same program. Application supports one only language (english) and and internationalization settings are defined through EnglishOnlyResourceFactory OpenSwing class. In this demo an example of window is reported: a frame that contains a tree component; user can drag ‘n drop nodes inside the tree, to move or copy nodes. Node description renaming is allowed too, by means of mouse right click. In this demo node icons are defined per node, by retrieving icon name from an attribute of the value object stored inside each node.
"revalidateTree" and "setMenuItemVisible" and "setMenuItemEnabled" methods usage are included too.

Demo32 | This is an email client application, based on MDI front-end that uses a set of IconifableWindows combined together inside an IconifableWindowContainer.
Demo33 | This sample application shows a frame that contains a TreePanel having clickable check-boxes.
Demo34 | This sample application shows internal frames in an MDI frame, where internal frames do not have a title bar: they can be closed only by windows bar at the bottom of the MDI frame.
Demo35 | This sample application shows an editable grid frame whose data is retrieved/stored using JPA.
Demo36 | This sample application shows an editable grid frame and grid+detail form frames whose data is retrieved/stored using Apache Cayenne ORM tool.
Demo37 | This is a stand-alone application, based on SDI front-end, that contains a frame with a tree+grid component, where grid rows are grouped through tree nodes. The difference with demo11 is that nodes in tree are fetched dinamically, when expanding a single node.
Demo38 | This is an MDI application that shows how to configure a LoginDialog with language selection, encryption password management (included the encryption password storing in database), account storing in local file system.
Demo39 | This application shows a frame that contains two tree components: drag ‘n drop feature is enabled for these components: draw is allowed from the first tree and drop is allowed to the second tree.
Demo40 | This application shows a frame that contains a grid component whose rows contain an inner grid components whose rows contains an inner editable grid component.
Demo41 | This application shows how to use ComboBoxVOColumn in grid control.
Demo42 | This application shows a frame that contains a grid having expandable rows, i.e. when a row is expanded, a nested Form panel is showed; this editable Form panel shows detail information about the expanded row.
Demo43 | This application shows an editable grid having a FileColumn used to upload and download files from/to local file system.
Demo44 | This application shows an grid where rows can be edited one per time.
Demo45 | This application shows how to setup permissions at column level, by providing back-end functionalities to define permissions in grid.
Demo46 | This application shows how to create a grid a run time, binded to CustomValueObject, in order to fetch data using dynamic SQL.
Demo47 | This application shows how to create a 3 tier client-server application having a front-end based on OpenSwing graphics components and business logic on server-side based on EJB 3.0 Stateless Session beans and JPA as persistence layer; comunication protocol is based on RMI (see README.txt file included in "demo47" source folder for more details).
Demo48 | This application shows how to create a unique toolbar at the top of the MDI environment, in order to bind it to each internal frame, so that the currently focused component will manage toolbar.
Demo49 | This application shows how to create a PivotTable component.

Documentation Download Spring integration Samples Tutorial Installation info Mailing lists Public forums Project Page

### Related Links

HSSF Log4J JCalendar Java DB Conn Pool

Licence | Contacts | ©2007 Mauro Carniel