JellySWT

JellySWT is a simple Jelly library which can be used to create SWT user interfaces. It allows XML documents (Jelly scripts) to be used to define the layout and rendering of SWT front ends which avoids lots of mundane Java coding, using markup to define the view of your front end and allowing you to bind to Java code for the business objects and models.

This mechanism uses seperation of concerns and MVC ideas from web applications, allowing the rendering of your SWT front end to be easily transformed (since its XML) into different styles while leaving your model and business objects untouched. It also allows different views to be constructed independently of your models.

There is an example JellySWT script here

To try running the example, cd into the [jelly-home]/jelly-tags/swt directory and type the following command, you should see a full SWT user interface appear with pull down menus, a simple form, a table, toolbar buttons, tooltip etc.

maven demo

Running SWT

Please be aware that SWT uses JNI and so requires a runtime library to be on your PATH for any SWT application to run. You can refer to this FAQ entry for more details.

For example on my windows laptop I copied the swt-win32-2116.dll from Eclipse into my PATH before running the examples.

Useful SWT Links

  • SWT Javadoc is very handy. Its mostly the widgets package thats of most interest.
  • This SWT Wiki has lots of good examples and documentation.
  • This page also has a list of lots of little example SWT applications.