This week's book giveaway is in the OCMJEA forum.
We're giving away four copies of OCM Java EE 6 Enterprise Architect Exam Guide and have Paul Allen & Joseph Bambara on-line!
See this thread for details.
The moose likes Beginning Java and the fly likes AWT vs. Swing Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of OCM Java EE 6 Enterprise Architect Exam Guide this week in the OCMJEA forum!
JavaRanch » Java Forums » Java » Beginning Java
Bookmark "AWT vs. Swing" Watch "AWT vs. Swing" New topic
Author

AWT vs. Swing

Jade Davidson
Ranch Hand

Joined: Oct 12, 2001
Posts: 64
What is the difference between using AWT components to create a user interface vs. using Swing? I am confused...
Cindy Glass
"The Hood"
Sheriff

Joined: Sep 29, 2000
Posts: 8521
The AWT components are "heavyweight" in that they have a peer component on the operating system. this makes their look and feel dependant on which OS you are running. The Swing components are less tied to the peer and are called "lightwieght". This is a pro for Swing.
There were some bugs and design problems with the AWT that were corrected in Swing.
Swing is much more powerful and much more flexible.
Swing is therefore much more difficult to use (some would say tempermental . . . ). Increased flexibility is approximately equal to increased complexity.
Swing comes with a whole new set of bugs and design problems . . .
Most browsers only support up to 1.1.8 without a plug-in. Plug-ins require the end user to do a download - so some people try to avoid this. Swing didn't come out until jdk1.3 - so using Swing virtually requires a plug-in if it is to be used in a browser.


"JavaRanch, where the deer and the Certified play" - David O'Meara
Wilfried LAURENT
Ranch Hand

Joined: Jul 13, 2001
Posts: 269
This is an excellent article stretching the differences between awt and Swing.
http://java.sun.com/products/jfc/tsc/articles/mixing/index.html
W.
 
Consider Paul's rocket mass heater.
 
subject: AWT vs. Swing