Swing or SWT when using WindowBuilder

In my last post I was trying to decide whether to use Swing or SWT when using WindowBuilder. I am using the Eclipse IDE.

Learning to use Swing or SWT

The problem is, there does not seem to be any clear cut view as to which is best. This post on stackexchange is typical.

Researching the options

Most of the forums/tutorials I found on Google tended to jump in at the deep end, assuming that you know the basics and it was not very helpful in making this decision. Then I came across this youtube video.

The sound quality is not that good, but it takes you from how to install WindowBuilder, all the way to using Swing to create a window. I actually followed the tutorial in real time and managed to get the same results (a window with a text button in it), which I though was quite impressive.

The tutorial uses Swing, and I have since heard that Swing is better for Windows applications. Whether that is true or not, I don’t know, but as I have to make a decision, I have decided (for now anyway) to adopt Swing.

If I am honest, I don’t think it actually makes that much difference. The applications that I intend to write will be fairly simple from a GUI point of view, so I doubt that I would really push the limits of either Swing or SWT.

Decisions made

Swing or SWT for the Eclipse IDE?
Eclipse IDE (Dowsnloaded from Google, vis Creative Commons – 06 Mar 2014)

Whether, this is a good decision remains to be seen – but at least I am making some decisions. I have decided to use Eclipse, and now Swing.

I think that these represent two of the major decisions and even they are not reversible. I can always switch at a later date.

Probably of more importance now, is to actually write some Java code. Knowing C++ should make this relatively easy, but bolting everything together within a GUI might be the major challenge!

 

 

 

2 thoughts on “Swing or SWT when using WindowBuilder”

  1. Hi Graham,

    As a former ASAPer, 10 year user of Eclipse as an IDE, and produce Eclipse RCP applications for work, I would say that they are about even. If your main concern is supporting Windows & Mac & Llinux (without building an Eclipse RCP product; which takes time to learn but makes this painless), then I would say Swing; checkout Java Webstart for example. But if you have one target platform to support, that is the same or similar to your development platform, then SWT will look better (i.e. not as outdated as Swing can look). Either way you are into anonymous classes inner like SelectionHandler/SelectionAdapter and remembering to run in the GUI thread or not. WindowBuilder is I would have started if it was most robust in the early days, and is where I am ending up now it is more robust, so you are basically in the the right place either way!

  2. Jonathan

    Thanks for this – and good to hear from a former ASAPer (they are gradually growing in number). It’s also good to hear from somebody more experienced that I am basically on the right lines.

    I have noticed that Swing looks a bit “old fashioned”. In fact, I used to notice this when I was supervsing final year dissertations. But, I just want a GUI, not necessarily a good looking one!

    Thanks again.

Leave a Reply

Your email address will not be published. Required fields are marked *