• 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 Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Swing & Awt

 
Greenhorn
Posts: 16
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi all

Why AWT and Swing as they are doing the same work
priya
 
author and iconoclast
Posts: 24207
46
Mac OS X Eclipse IDE Chrome
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
AWT was there first; Swing is much newer, and builds on AWT.
They don't do the same work at all. AWT provides lowest-common-denominator access to the native window system's widget set. Swing provides a set of much more complex components which are drawn entirely from Java. Whereas AWT has the native platform's look-and-feel (well, sorta,) Swing implements pluggable platform-independent look-and-feels.
 
Greenhorn
Posts: 20
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
To elaborate a bit on what Ernest said, you'll hear the terms "lightweight" and "heavyweight" thrown around a lot when discussing these two. AWT is heavyweight, like Ernest said they go down to native calls to render the components, which is often a pretty intensive call. Swing, on the other hand, is lightweight. Rendering most of the components im memory, Swing is typically much faster (I say typically because a lot of it still depends on code design).
My understanding is that Swing started as a project internal to Sun, it was a bunch of developers who just pieced together cool components from AWT components. It took off from there.
 
reply
    Bookmark Topic Watch Topic
  • New Topic