JJCC Blog

Saturday Feb 03, 2007

Our Java Stack: Swing User Interface

With most of JJCC's work dominated by web applications, it's a rare opportunity to step away and work on a rich client. Health Occupation Students of America provided just such an opportunity a little over a year ago. The design for the HOSA Conference Management System called for a thick client capable of running stand-alone while staff worked on-site at the conference. The interface did not have to be pretty so much as it needed to be user-friendly and functional, and as usual, time was short.

In past graphical user interface projects, I have used Java AWT, Java Swing, OS/2 Presentation Manager APIs, and the Microsoft Foundation Class Library. I even went so far as to write a cross-platform GUI class library with support for both 16-bit Windows APIs and OS/2. Not looking to reinvent the wheel this time around, I needed to find a tool to build screens and connect them to data much more quickly.

As leery of GUI programming tools as ever, I set out to investigate some of the XUL (XML User Interface) options available. Initially, Mozilla caught my eye with its XULRunner. Being new and somewhat unstable handicapped Mozilla's offering as did requiring Javascript for coding actions. Javascript would have been fine, but there would have been a learning curve.

Having been exposed to XUL by Mozilla, I then started reviewing some of the Java XUL frameworks. Some were too big and cumbersome, others were incomplete or poorly documented, and still others were just too simple. It wasn't until I stumbled onto SwiXAT that I found something that I thought might work.

SwiXAT is not so much an independent project as it is a coming together of several useful parts into a more efficient whole. The basic XUL displays are written using SwiXml, but with SwiXml, you can do little more than mock up the screens. You still have to write code to load and display the screens and process events and actions. This is where SwiXAT shines. It allows you to wire user interface actions and events to BeanShell scripts. It also allows you to populate controls using JavaBeans accessed through JXPath. The end result is a stable, functional application written with a minimum of compiled code.

As long as you are not a GUI design fan, the only downside of SwiXAT is that it isn't all that popular and has not reached a stable version yet. Nevertheless the original architect, Paolo Marrone, remains active and helpful on the mailing list, and I have yet to see an application failure attributable to SwiXAT or its components.

If you're considering a XUL framework, download SwiXAT and give it a shot. You won't be disappointed.

Comments:

Post a Comment:
  • HTML Syntax: Allowed

Feeds

Search

Links

Navigation