File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

AWT vs. Swing

 
Jade Davidson
Ranch Hand
Posts: 64
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
What is the difference between using AWT components to create a user interface vs. using Swing? I am confused...
 
Cindy Glass
"The Hood"
Sheriff
Posts: 8521
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.

 
Wilfried LAURENT
Ranch Hand
Posts: 269
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
This is an excellent article stretching the differences between awt and Swing.
http://java.sun.com/products/jfc/tsc/articles/mixing/index.html
W.
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic