which library better for faster java application swt or swing?
According to wikipedia there is no clear winner (although you can edit that if you want). Inevitably, you can write benchmarks which will show either much faster that the other. Swing has more freedom to optimise on the Java side of things. SWT can allow more optimisations to occur within the windowing system.
Probably the bigger impact on performance is going to come from how your application behaves. Concentrate on getting your code clean (and do a little profiling when necessary).
Several years ago Swing was slow so SWT was developed to make native API calls on systems. However, Swing performance has greatly improved and this is no longer the case. SWT is non-standard, while Swing is officially part of the Java spec. JavaFX will also be built on top of Swing. Unless your job requires writing Eclipse plugins, I would use Swing.
To see a really good app developed in Swing, take a look at Jetbrain's Java IDE. You can try it for 30 days.
http://www.jetbrains.com/idea/
Of course, Sun's Netbeans is a pure Swing app too and it's free.
There is no slow swing application. Just poorly written. And this also apply for SWT. The most application make better responses because of eclipse core architecture. Before J6 there were several problems with gray windows during unresponsive periods but this is quite solved using fully double buffered approach in swing PLAFs. There is no better UI framework. There is only better written program which appropriately uses multi-threading to avoid unresponsiveness of UI. Personally I prefer Swing :)
"faster" is subjective. Both can run fast, but it's easier to do something dumb to shoot yourself in the foot with Swing and make it feel slow.
That said though, I find Swing easier to work with at a code level than SWT.
Today, both frameworks are fast. I suggest to check these criteria:
- SWT is more simple to use than Swing (especially if this is your first UI)
- Swing is older and you can find more components
- If you also use JFace, you will find many powerful widgets that work out of the box (where you would need a lot of additional configuration in Swing).
- Swing is available anywhere, SWT is not
- SWT is developed actively, you have the source and bugs are fixed quickly. Swing hasn't been touched in years, then there was suddenly a big update for Java 6. If you have an issue with Swing, well, Sun probably doesn't care.
- If you choose Swing, use a framework like SwingX. This will make your life much more simple.
Technological decision towards the widget toolkit are pretty thin ice in my eyes. The amount of work you'd have to deliver when it comes to the application framework is considerable and much more decisive IMHO. I believe that the only argument that's in favor of SWT is it's native L&F. On the other hand most UI's tend towards non-native L&F nowadays. You clearly see this in the trend for Eclipse RCP apps to use the forms framework which paints custom gradients and sections and is no native interface in any way (the same applies to e4, the eclipse v4 elaboration project). To sum up, If RCP's an option in your project, I'd use Eclipse RCP (which is SWT). The completeness, vivacity and tempo this platform has is unbeatable. If RCP's not an option, Spring RCP looks pretty convincing to me (which is Swing based).