• Post Reply Bookmark Topic Watch Topic
  • New Topic

Difference b/w AWT and Swing

 
Pradeep bhatt
Ranch Hand
Posts: 8933
Firefox Browser Java Spring
  • 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
 
Nathan Pruett
Bartender
Posts: 4121
IntelliJ IDE Java Spring
  • 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.
 
Ayan Kumar Roy
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
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!