11 March 2007

AWT SWING SWT

Most of the time difference of that tripod is asked to me.
Arguement arieses from the que, Which one to choose?
If you int to create gui via core java, as far as i know you have
no fourth choice. You may find, some more derivations of these approaches.

Lets compare and contrast :)

Our first toolkit is abstract windowing toolkit. I deliberately say first toolkit
since awt is the only set of gui classes when java first created.
Like all, you can create windows, buttons,text fields and other stuff via awt.
Awt run on any OS.
But Awt's working princeble is a bit problematic. :(
It uses peers. You can think this as a layer. These peers enable to communication via
os's guis code.For instance on a unix computer peer works between awt code and unix code.
So what is the promblematic issue. :D

The AWT can’t do anything that’s not similar across all operating systems. If two
operating systems do radically different things to display trees, then the AWT
simply cannot display trees.

Then Swing appears and solves the problem. It relies on nothing.(Not only peers)
Actually, It is complicated and hard to understand some layout tips.
But OOD, OOP and Java can be understood well via learning and using swing.
You should have the full control on the java language if you are doing some stuff on
Swing.

It is pure java, and in my opinion if you are using gc,jvm properties well, if you care on
object creation stratejies you can write guis working with high performance .
But i should note that: many developers are insist on saying that it is slow.

Standart Widget Toolkit , Widget is a component in a graphical user interface.
For example button is a widget. ;)
It borns in IBM. In IBM they are creating widgets for SmallTalk.(Pr. Lang.)
Then it is moved from smalltalk to Java.
In compare to swing it is found fast. And it is easier to understand and write.
Swt beats java motta. (Write once, Run Everywhere)
Like AWT It is not a pure java.
UnLike AWT it has no peer layer.

Sun’s NetBeans IDE calls Swing classes to display
its dialogs and editors, and Eclipse calls SWT classes.

This difference between NetBeans and Eclipse has several important consequences.

In theory, Eclipse isn’t as portable as NetBeans.
Eclipse can use tools that are specific to each operating system.
Eclipse’s graphical interface isn’t merely an imitation of your computer’s
interface.
Eclipse runs noticeably faster than NetBeans (unless you run
NetBeans on a very powerful computer).

SWT take gui objects from the operating system objects.
Look :








It is interesting. But don't forget. SWT AWT is Os dependent.
Swing is pure java.
For Shortcut::
:)
Swing hard.
SWT easy.
AWT depreceated :(
Both popular :)
Netbeans use Swing
Eclipse use SWT

Altough my fovarite one: Swing I am a Eclipse fan :D
(Not sure but, Propably :)), Like awt, I also depreceated :(

By the way, Please look this IBM link from Barry Feigenbaum about SWT, Swing or AWT: Which is right for you?

No comments: