This post originated from an RSS feed registered with Java Buzz
by Marc Logemann.
Original Post: Swing vs. SWT
Feed Title: Marc's Java Blog
Feed URL: http://www.logemann.org/day/index_java.xml
Feed Description: Java related topics for all major areas. So you will see J2ME, J2SE and J2EE issues here.
Recently i ve done some research in the GUI area, a customer was in the process of defining a Java GUI framework and asked me about my oppinion about it. To say, this customer is not small and he wants to reprogram a lot of its ERP system in java.
These days, in each corner you see an IT addict shouting SWT into your face. Most of the folks say that using Swing is some kind of old-fashioned and there is only one way to go: the SWT way. So i sat down and programmed a few GUIs with SWT and give it a whirl.
Here is my conclusion:
The coding is ugly, so many constants and so much similarity with MFC. Its of course faster because of its design and the use of JNI and native Widgets, so its responsiveness is nice. But again, the coding is horrable. You know the good old models in swing? Nothing equivalent in SWT, if you rip of some JFace components of the eclipse tree, you get Views, which are better than nothing but still not as good as the models in Swing.
Because i am not as bright as some people think, i still need documentation, and preferable not only javadocs but also some kind of 3rd party literature. With Swing you got plenty of this, from our favourite publishers like ORA and sun. With SWT, again, you wont get anything but some IBM/OTI articles. This will slow down development noticeably.
At the end, there is another contra-killer-argument: SWT is not a standard. Its totally driven by IBM and OTI and Eclipse is the only major application which uses SWT. Even its very unlikely that the support will be dropped, i feel a little bit dependant of these companies.
I will still use Swing with all my GUI projects, not too much anyway, and live with the micro-seconds delay when opening trees or menus. But people forget that a "fast" application is not only widget-responsiveness, in real life, applications suck at database calls and business logic, there SWTs speed wont help you in any way.