File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
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
JavaRanch » Java Forums » Java » Beginning Java
Bookmark "AWT vs. Swing" Watch "AWT vs. Swing" New topic

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"

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.
I agree. Here's the link:
subject: AWT vs. Swing
It's not a secret anymore!