2

I have to develop a desktop application using Java. I've some experience with Java Swing, but user interfaces developed using it are not so good looking... I know that Eclipse is developed using another framework called SWT. Is it as portable as Swing?

Is there some other framework to try and what is the experience using it?

Peter Mortensen
  • 30,738
  • 21
  • 105
  • 131
davioooh
  • 23,742
  • 39
  • 159
  • 250

5 Answers5

2

There are significant differences between SWT and Swing. It really depends on your application's needs. Back for your question, SWT is also portable like Swing, but for each platform you have to use a different library which uses the platform's native implementation.

Community
  • 1
  • 1
Sorceror
  • 4,835
  • 2
  • 21
  • 35
2
  1. Since it is very confortable using predefined objects and drag and drop them from a palette, and in most cases it is so hard to override basics methods, then you need to add another custom API for basic methods that are implemented by default in AWT/Swing,

  2. All the Java custom frameworks are based on overriding methods that comes with AWT/Swing.

  3. Use standard Swing JComponents and use a custom look and feel rather than bothering with private non overridable Objects implemented in the Java GUI frameworks. Then you can implement Java GUI with a nice look similar to modern WWW frameworks based on HTML5.

Community
  • 1
  • 1
mKorbel
  • 109,525
  • 20
  • 134
  • 319
1

Basically there are the two big and one minor player:

  • AWT/SWING
  • SWT

Beyond that there is QT-Jambi - which is quite new and not very common. (http://qt-jambi.org/)

SWT provides native libs for Win/Mac and behaves quite well. It also has nice tooling (see WindowBuilder)

light_303
  • 2,101
  • 2
  • 18
  • 35
  • __"Native libs"__ means that I have to recompile when I move from an OS to another? – davioooh Jan 02 '12 at 11:13
  • No it means you download different libraries for different OS targets and then you create different run commands for OSs or you dynamically load appropriate library at app start. – Sorceror Jan 02 '12 at 11:17
1

Both the NetBeans platform (pure Swing, but good looking, and adaptable look&feel), and Eclipse RCP (SWT) do. I find Swing definitely better, but I am biased. Both require a large effort.

Peter Mortensen
  • 30,738
  • 21
  • 105
  • 131
Joop Eggen
  • 107,315
  • 7
  • 83
  • 138
  • Why do you prefer Swing? Is SWT more complex? – davioooh Jan 02 '12 at 11:14
  • It is native with an event loop, where Swing is customizable, totally accessible. With SWT one sometimes has to live with what is offered. But I was already early turned off by this reinvent-all approach. Even if SWT would work on Android or tablet, I do not trust it. But I am _not_ objective. Look a bit around yourself. I did not like the extra destruction care one has to take, and I heard that eclipse RCP was too bound to the IDE. That I cannot say for sure. – Joop Eggen Jan 02 '12 at 14:49
1
  • Swing is very powerful, but a bit complicated.
  • AWT - don't use it at all (Swing was designed to solve issues with AWT).
  • SWT is claimed to be faster than swing, although in modern versions Swing is also fast enough.

I would consider JavaFX as a next generation GUI framework for new projects as long as you have to stay in the Java camp. JavaFx is built with modern concepts in mind. But it's not widespread, and there are not a lot of projects written with this technology.

Peter Mortensen
  • 30,738
  • 21
  • 105
  • 131
Mark Bramnik
  • 39,963
  • 4
  • 57
  • 97