• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Liutauras Vilda
  • Jeanne Boyarsky
  • Devaka Cooray
  • Paul Clapham
Sheriffs:
  • Tim Cooke
  • Knute Snortum
  • Bear Bibeault
Saloon Keepers:
  • Ron McLeod
  • Tim Moores
  • Stephan van Hulst
  • Piet Souris
  • Ganesh Patekar
Bartenders:
  • Frits Walraven
  • Carey Brown
  • Tim Holloway

Difference b/w AWT and Swing

 
Ranch Hand
Posts: 8934
Firefox Browser Spring Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,
Can someone pls list out the differences b/w AWT and Swing.
Thanks
 
Bartender
Posts: 4121
IntelliJ IDE Spring Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
There are wa-a-a-ay too many to list here...

Swing is built on top of AWT.

AWT resides in the java.awt.* package and it's sub-packages.
Swing resides in the javax.swing.* package and it's sub-packages.

Every AWT component has a native peer, while only top-level components in Swing have a native peer.

Swing uses MVC (Model-View-Controller) architecture. Most Swing components have an xxxModel to represent the model, xxxUI to represent the view, and listeners to represent the controller. The Jxxx class ties all these together.

Swing adds several new components... tables, trees, color choosers, etc.
 
Greenhorn
Posts: 10
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
AWT classes are not "pure" java classes, they inculcate some native codes also(different looks in different OS's)
while Swing has no native code at all,written entirely in Java
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!