This week's giveaway is in the Threads forum.
We're giving away four copies of Java Concurrency Live Lessons and have Doug Schmidt on-line!
See this thread for details.
Win a copy of Java Concurrency Live Lessons this week in the Threads forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

why swings r heavyweight component  RSS feed

 
Gaurav Chikara
Ranch Hand
Posts: 413
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
can any one tell me why is it so
and why swing r not browser compatible while awt are compatible
 
Manfred Leonhardt
Ranch Hand
Posts: 1492
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Gaurav,
Because Netscape and Microsoft didn't include support for Java 2 (Swing, etc.) inside their browsers. They only support heavyweight components (AWT) because the browser needs less code to maintain.
AWT is heavyweight because the OS does the rendering (drawing/functionality).
Swing is lightweight because it draws itself. Therefore we don't need to use the OS code (big and very heavy).
One Swing drawback is that the big and heavy OS code is already present on every computer and therefore fully compatible with any application that runs on it.
One Swing pro is that a single application can look the same no matter what the OS running is. Now we can have windows look-and-feel applications running inside Unix and Macs!
Regards,
Manfred.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!