views:

2340

answers:

5

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 :)

+5  A: 

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.

Eddie
They have shipped Qt with LGPL, so that is not a concern anymore. Thanks for your well-put comparison. :)
Adeel Ansari
@Vinegar: Ah, thanks for the information about Qt with LGPL. I typically use Gnome, not KDE, so I don't follow developments with Qt.
Eddie
Ah... fair enough.
Adeel Ansari
+3  A: 

I have no experience with SWT, yet I was working with Jambi/Qt, Swing and GTK as well. The only problem with Qt/Jambi is licensing in my opinion (you must either publish your soft under GPL or buy commercial license). You can't start writing software for free and then "see what happens". You must be sure that your software will be success, because you have to buy licenses. This in many times is not a case.

Regards.

Ooops, I overlook those comments, thanks for the reply. This is great news! Good move from Nokia.

@cursa that wasn't said, so also note that Qt/Jambi is more than widget toolkit. You have classes for networking, strings manipulation (along with regexp engine), mutexes, 2d vector & raster graphics, openGL and many more. This gives real boost to application development.

I also recommend downloading Qt package to Jambi noobies, because of very nice help browser called Assistant which Jambi is lacking. All the API of Qt and Jambi is the same (except slots and signals), even documentation is unchanged so you can use it interchangeably.

No Zax, please see my comments to Eddie. It has been released to LGPL, so the issue is no more. (No negative vote cast)
Adeel Ansari
A: 

I would not recommend SWT. SWT is a bad designed library with a lot of hacks and bugs. You will be looking the whole time for workaround for the simple UI-tasks

+3  A: 

You know Qt Jambi is discontinued following the 4.5 release this month? That doesn't make it a bad choice. Qt has other community-maintained language bindings that live outside Trolltech's control.

http://www.qtsoftware.com/about/news/preview-of-final-qt-jambi-release-available

A: 

I wouldn't rule out SWT as it is a great success in the eclipse world. I've been using it happily for about 6 years and never had to resort to swing.

Hasan Ceylan