Search code examples
javauser-interfacecross-platformswtjambi

Qt Jambi vs SWT for cross-platform GUI development


I'm currently involved in a project developing applications primarily for Linux (Fedora 10). However, it might be the case later on that we will have to port these applications to Mac OS X and Windows and we don't want to be caught out by choosing the wrong GUI toolkit.*

For a variety of legacy reasons we are locked into using Java. We are in the process of deciding between using Qt Jambi and SWT for the GUI. I haven't much experience in using either of them so I'm doing some small prototypes to try and get a feel for them. So far (just developing on Linux) there isn't much difference between them. However, there's a limit to the depth I can go in a short time. This is why I'm asking for help.

The particular features of interest to us are:

  • Frameless windows

  • custom shaped windows (i.e. not rectangular)

  • aesthetically pleasing

Does anyone have any experiences and/or insights into these two libraries that might trip us up later?

  • Agile programming people will no doubt jump on the phrase "might be ... later on" and say we shouldn't worry about it. However, in the absence of other deciding factors between the toolkits, future extensibility options will do. I promise not to write any cross-platform specific code until I have to :)

Update 11 Feb: Thanks for the great answers. For those that are curious, we will probably go with Jambi. It was mostly the style sheet functionality that won me over as they make easy a lot of the custom widget shape stuff we need to do. The Qt suite of examples showed that frameless, custom-shaped windows do indeed work on different platforms, so we shouldn't be caught short down the track. The LGPL release was why we were considering Jambi at all :)


Solution

  • I agree with Vinegar: Don't rule out Swing. I've developed both with Swing and with SWT, but not with Qt. With Swing, your code will be automatically cross-platform. With SWT, your code is cross-platform with a little effort, although not that much effort. Are you going to implement a local application, an Applet, or a Web Start application?

    The advantage of SWT is that it uses all native widgets. (familiar Look-and-feel.) The disadvantage of SWT is that it uses all native widgets. (not as many widgets as Swing has) Whether this is more an advantage or a disadvantage depends on what you are doing and what your goals are. This means that Swing has a greater breadth of widgets. However, there are a few things that SWT does that Swing doesn't do as well (or at all) -- such as launch the system's native browser and execute JavaScript scripts in this browser.

    If you consider SWT, consider it carefully. If you have certain needs (such as executing JavaScript in a browser window that was launched by your application), then it may be your best choice. However, if Swing can entirely meet your needs, it may be a better choice.

    Hopefully someone else can provide information about Qt Jambi.

    Note that support should be a consideration in your decision. With SWT, there is a smaller community supporting it. With Swing, a larger community, but this does not mean that fixes will get more quickly into a development release. With Qt Jambi and with SWT, if a bug is fixed, you just distribute updated libraries with your application. With Swing, you have to wait for an updated JRE. Neither is necessarily a dealbreaker, but it has to be considered.

    Licensing fees may or may not be a consideration. SWT and Swing, of course, do not have licensing fees Jambi I don't know about either way, but it may depend on your intended use -- for example, are you distributing a GPL application, or a commercially licensed one.

    Good luck.