I am new to GUI development and am trying to learn some stuff.
Can someone please explain to me the difference between AWT and Swing?
are they related? Are they just two different libraries from which I can
choose from to
draw GUIs?
Thanks in advance for your help.
> I am new to GUI development and am trying to learn some stuff.
>
[quoted text clipped - 5 lines]
>
> Thanks in advance for your help.
Swing is the newer 'incarnation'. Most Swing classes extend from awt
classes. If it begins with "javax" it's 'swing'.
General rule is don't mix the two.
Some folks use awt for applets.
>I am new to GUI development and am trying to learn some stuff.
>
> Can someone please explain to me the difference between AWT and Swing?
> are they related? Are they just two different libraries from which I can
> choose from to
> draw GUIs?
My Java class earlier this evening introduced this exact topic, so I'm gonna
take a stab at this one to see if I understood what the prof had to say...
For starters, AWT was around first and Swing inherits a bunch of stuff from
AWT (Swing extends AWT?). AWT depends on the underlying OS to draw things
like buttons, frames, checkboxes, whatever, so if a particular feature
doesn't exist in a particular OS, then an AWT program won't work right.
AWT java.awt.*
Swing javax.swing.*
Swing's a lot bigger than AWT because it contains a lot of features that are
missing from the earlier libraries, and it's more platform independent.
You can apparently mix them, but it's recommended that you don't.
If there's anything that I got wrong, corrections would be much appreciated