SWT is an emerging Java GUI toolkit that gives Java developers access to the operating system’s native widgets in a cross-platform manner. After using it for several major projects, I have found myself implementing certain tasks repeatedly, so this series of articles endevors to share a few of the insights I have gained to make working with this toolkit more rewarding.
Thank you, SWT is becoming _the_ platform for GUI-building with Java (better forget using the Swing-thing with real apps)
Good SWT Documentation is still hard to find…
and use Swing. Really, which bitch whenever Microsoft breaks with the standards and we should do te same for IBM for SWT. Just look at how many binaries there are for it!: http://azureus.sourceforge.net/download.php . Really, who is running a computer that old that Swing takes considerably more time than SWT and yet can still run the rest of Java reasonably well. Just use Swing.
No.
God no.
Java will not be able to compete with .NET using Swing.
SWT is what Swing SHOULD have been.
Someone should just take SWT and submit it to a standards board or something (maybe along with some other stuff) and call it a standard.
yes and this was rejected by SUN due to commercial rivalry. yet another reason java should really be a ISO standard instead of SUN controlled psuedo community thingy
So lemme get this straight, a Widget is called a Control in SWT? No wonder SWT isn’t really catching on. Who the heck came up with that idea? Must have been someone that has been programming for Windows for too long…
No. Swing is why Java has failed on the desktop.
@Richard S. – Are you really getting your panties in bunch because someone is calling them controls and not widgets?
I have to agree – I never understood why Sun didn’t release a GUI toolkit with native support. Everytime I use a Java GUI application, I ask how Sun could ever expect us to make do with this. Java will never be a dominant desktop player with SWING; and I also agree it is the primary reason Java will fail when facing Microsoft’s products.
I don’t see a reason to switch to SWT, anymore. Swing also has the ability to set a Native Look & Feel, using PLAF(Pluggable Look And Feel). Also, I find it easier to write Swing than SWT, but that’s just my personal opinion.
For me it isn’t the look and feel – I find SWING to be slow. My PC isn’t exactly modern hardware, but neither is it really ancient!
I’ve started testing SWT and it’s nice, but at work we use Swing with the JGoodies L&F, and to be honest I can’t complain and the customers don’t either. I agree that the default look – Metal – is ugly and that it used to be slow, but with reasonable hardware and the JGoodies L&F it runs sweet and looks good !
When comparing .Net to Java, I presume you mean .Net to J2EE? In which case id like to point out that the GUI plays a very unimportant role most of the time.
But yes for the mainstream desktop I do think SWING has impacted Java’s popularity, and more significantly given people the _IMPRESSION_ Java is slow, which it is not.
the moment you need separte binaries for Java is the moment it is no longer really java. I mean why not just add pointer arithmetic too while were at it?
swing is fast enough now and as computers are getting faster. i run netbeans (probably one of the largest java/swing apps that will be on people’s desktops) on a p3m 850mhx w/ 256 RAM and it runs well. slower than it would probably with SWT? perhaps. but fast enough.
swt is what has me convinced that sun should NOT let other people meddle with java at whim. really it is a benevolent dictatorship.
Java, too is binary, so what? It also comes with native awt*.dll’s, .so’s, whatever.
Not only is SWT more CPU-friendly, it also tends to use less resources due to the direct native binding of the controls (or widgets, gadgets or whatever you grew up with ). Only drawback is that you have to remember to free some of the stuff you allocated (images, windows, whatnot).
Eclipse is a hell of a lot more responsive on my Athlon64 with 1GB of memory than Netbeans will ever be. Apart from the fact that it is _A LOT_ more stable as well. I used to be a Netbeans user myself until last year when one of my colleagues finally convinced me to switch, a decision I have not regretted yet.
It’s fun working with Eclipse because it doesn’t feel like a Java application (at least not here on Windows). Up until last month I used Eclipse along with Netbeans since there wasn’t (and I think still isn’t) a decent GUI editor so I used Netbeans for the GUI creation stuff and Eclipse for the actual coding. Even then I was shocked to see how many Exceptions this thing could throw at me during the course of an hour. But then again that’s also history now since I switched to using cookXml for the GUI stuff.
Apart from that I have used SWT for one project so far and the learning curve wasn’t too high (many of the classes have the same names as the SWING counterparts, _Component_ being of them). It really does make a problem, JGoodies or not. If I wouldn’t be working on SUN projects at the moment I sure would write my current stuff in SWT as well
… does make a difference … even
That’s what 30h of coding can do to you.
Why not just use C# if you are going to use SWT. The goal of java is write once and run everywhere(almost). win and linux is not everywhere!!!
Is because most of the apps are written by inexpirenced programmers who don’t have any idea how to properly write asynch applications.
As a now very veteran Swing developer, I can vouch for my personal expirence in looking at -many- programmers swing code that the reason it’s slow, nasty, and generally sucks is not due to a lacking toolkit, but a developer lacking any semblance of know-how.
SWT is a cop-out. It’s lets stupid developers write shitty code and masks _some_ of the consequences. Having to distribute a bloody shared library, convoluted startup binaries (or scripts) etc, is not going to help Java on the Desktop. Duh.
Swing may not be perfect, but it’s far better than SWT for portability, and if you take the time to read the javadocs, investigate the causes of your slowness, and remember not to clog the event thread with buttloads of code, you’ll find your swing apps will zip right along. Have it detect the native platform look and feel at startup, and you’ll be surprised how many people don’t realize it’s Java.
Ah, I see… now you are saying that people should use AWT if they want native controls. But I guess there must be a good reason why it got replaced by Swing, even though I’ve never had to use AWT myself (was long before my Java time).
I don’t get your point though. I was talking about native looking applications, efficient resource usage and better performance. AWT can give me that?
And what does shitty code have to do with using either toolkit? Just because in Swing you have to try harder to get nearly the same performance as you get in SWT doesn’t make it the better toolkit, the opposite. With SWT you can concentrate on the code. Currently I am spending more time on the GUI than on the underlying implementation which to me is not a good thing, sorry.
Only good thing I can say about Swing is that it is readily available on every platform, since its AWT core is shipped with the JDK where SWT’s isn’t.
And to your tone, let’s not get personal here
I downloaded the Java 1.5 RC and tested the Swing sample applications. It’s true they offer a native “look and feel” but it’s very noticable that it’s not really using native widgets (because of small yet annoying quirks, like not respecting system wide menu shading effects and MDI child windows being rather slow to move around even on my fairly snappy machine. The devil is in the details they say. Personally I hate apps that break the “standard” even in subtle ways and I feel SWT is desperately needed for Java to gain popularity for desktop applications.
we are *only* now getting a decent java port on BeOS (see http://bryan.varnernet.com/ ), but now we’ll also have to port SWT…. yuck :^)
(but if it means getting the real BeOS L&F – including scriptable controls, pervasive D&D, … – then why not.)