why swing are lightweight while awt are heavyweight?
Loi San Choon
posted 14 years ago
Because each "heavyweight" component has a native peer, and "lightweight" components do not. Since AWT is heavyweight, each AWT Button has a corresponding MFC button on the windows platform, or Motif button on a Unix platform. Since Swing is lightweight, the graphics of the button is just drawn on top of the frame... there is no underlying MFC or Motif button. You can find more information on this topic in the article "Mixing heavy and light components" on Sun's website.