• 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

difference beteween SWING and AWT

 
Greenhorn
Posts: 8
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
hello sir

as it is generally asked i the interview that whats the difference beteween SWING and AWT .

please tell me the some important differences beteween both.

thanks you
parul
 
Ranch Hand
Posts: 140
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hello Parul,

Swing classes are pure Java classes that look the same on all operating systems. AWT Java classes are not pure Java classes. They use underlying C/C++ native code (OS dependent) that can cause different appearances in different operating systems.

There are no big architectural differences; the class hierarchy is almost the same. The difference lies in the way the two are drawn on the screen. AWT components are heavyweight components with their own viewports, which send output to the screen. Swings are lightweight components and do not write themselves to the screen, but instead redirect the screen to the components it builds on. Heavyweight components have their own Z-ordering. This is the reason why Swing and AWT cannot be combined in a single container. If they are, the AWT components will be drawn on TOP of Swing components.

Hope that helps,
reply
    Bookmark Topic Watch Topic
  • New Topic