Is SWT Ready for the Years to Come?

Is SWT Ready for the Years to Come?

With all of the current mobile and desktop operating systems we use all day, most users expect a great deal from an application user interface.

People take things like animated transitions, gesture-based navigation, transparent controls and high resolution graphics, for granted.

Yes, SWT recently added Touch– and Gesture Listeners.
And yes, you can set alpha on a shell.
And yes, you can use a FormLayout to have overlapping UI elements.
But it still feels like SWT is lagging way behind modern Widget Toolkits.

With Tabris and the Tabris UI we introduced additional APIs and abstraction to provide you with the modern functionality that SWT is missing.

But still, I would love to see – rather sooner than later – image support for different resolutions. Something like an ImageRegistry where you register your default 16×16 image and a couple of alternative images in other resolutions (24×24, 32×32) for higher resolution displays. Then you would just reference the default image in your code. However, at runtime SWT could determine the appropriate image to display instead.

So, what are your experiences? Any other things you are missing in SWT?

Please leave you comments below.

Here a practical takeaway:

If you are a MacBook Pro user with one of those high resolution Retina displays, you might have noticed that Eclipse is not a joy to look at.

Default and Retina closeup

Default and Retina closeup

Enabling Retina (HiDPI) on the Mac

With the following command, you can enable high resolution rendering of native UI components such as widgets and text on a system-wide level:

defaults write -g AppleMagnifiedMode NO

I’ve tested this for the past six months without any problems.

Most of the UI looks smooth, but things drawn by GC are displayed with double-sized pixels to maintain the right sizes on the screen and therefore look pixelated.

  • Erdal Karaca
    Posted at 13:37, 2013-06-17

    Expected a comparison of SWT vs. JavaFX vs. QT Jambi or the like: So, what it is the answer to the title’s question?

  • Xewal Azad
    Posted at 16:03, 2013-06-17

    ob Javascript für jene “years to come” bereit ist, will ich aber auch bezweifeln.. ich wünsch mir ja ne richtige integration von Qt, die sind ja eh imma n schritt oda zwei weiter als java.. swt auf basis von Qt wär n anfang 🙂

  • Dan Howard
    Posted at 17:00, 2013-06-17

    With Java 8 and the additions of 3D – JavaFX is the future.

  • John Steele
    Posted at 21:59, 2013-06-17

    I would like to see JavaFx get adopted by more companies.

    In my opinion SWT takes extremely way too long to accomplish something. There’s a few handy factories e.g. GridLayout/DataFactory, but overall I think it’s way to difficult to accomplish something that should be relatively simple. The API is extremely too verbose.

    I’ve personally seen a developer take several weeks implementing a view with a few simple tables. I’ve also seen a developer spend weeks trying to figure out how to embed multiple images, styled text / hyperlinks, and background colors within table cells. Once it was finally implemented it was extremely buggy because he had to override the paint method, set/unset the cursor on hover, blah, blah, blah, drives me crazy. Then comes the issue of when it’s run on XP/Vista/7.

    For the most part I haven’t ran into any issues with SWT where I couldn’t do something. It’s more a matter of how much time and how painful the process is.

  • Kai
    Posted at 16:59, 2013-07-31

    I’m waiting for an implementation of swt using JavaFx…