SWING and SWT
swing is pure java concept provide light weight component and Garbage Collection, but on the other handSWT is native and need manual manage resources using "dispose".
so which will be better choice to createGUI .
swing is pure java concept provide light weight component and Garbage Collection, but on the other handSWT is native and need manual manage resources using "dispose".
so which will be better choice to createGUI .
Swing!!! :)
? what ur trying to say from ur reply
you ask which is better to use, so i answered swing...
this is my own opinion because I'm comfortable with swing
you might ask why. So read this go to architecture.
http://en.wikipedia.org/wiki/Swing_(Java)
Message was edited by:
Yannix
The advantage of SWT is the Java code wraps native widgets. For example, on Windows, when you build an app with an SWT button you are literally getting a Windows button -- with all the look & feel benefits that a real Windows button provides.
Swing, on the other hand, is a set of 100% Java widgets that are drawn on the screen to look and behave exactly like the native widgets. For the most part, I'd say you'd be hard pressed to tell the difference between the Swing widgets with the native look and feel, but there are some subtle differences.
I have found that SWT is harder to work with than Swing. I've never been able to figure out the SWT layout managers and action listener stuff.
Often you will want to extend the basic components to add your own functionality -- like, in Swing you can do "MyFunkyButton extends JButton" and do funky stuff in your own version of the button; my understanding is that sort of inheritence is unavailable in the SWT components.
If you're asking for my opinion, I'd go with Swing over SWT. But lots of people (including the Eclipse folks) would disagree.
My best advice is to spend some time doing some simple "hello world" types stuff in both and see which one you prefer. And please post your conclusion to this thread when you're done!
slegge
PS. If you liked my answer, please award me some Duke Stars!
SWT if you are developing something for an existing SWT application (Eclipse components, for example) or are wanting something that absolutely looks like a native app.
Swing if you want something simpler* and more flexible.
* Particularly if you know AWT... although if you never used any of them, then maybe SWT is no harder to learn... both have a steep learning curve.