Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsWhite Papers
Discussion GroupsFirst AidDatabasesJavaBeansGUIJava 3DVirtual MachineCORBASecurityToolsGeneral
Java DirectoryOpen Source ProjectsSample Book ChaptersUser GroupsWeb Resources
Related Topics
Databases.NETMore Topics ...

Java Forum / First Aid / March 2005

Tip: Looking for answers? Try searching our database.

AWT and Swing

Thread view: 
john smith - 15 Mar 2005 03:04 GMT
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.
Hal Rosser - 15 Mar 2005 07:04 GMT
> 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.
Paul Fedorenko - 15 Mar 2005 07:13 GMT
>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


Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.