A "heavyweight component" is a GUI component like a button or combo box which uses the native system's component to draw itself; AWT components are heavyweight.
A "lightweight component" doesn't have a native part; it's drawn entirely using the Java2D API. This means that Java can do all sorts of interesting things with the component as far as changing its appearance, combining it with other components, printing it, etc. [ April 26, 2005: Message edited by: Ernest Friedman-Hill ]
That's the technical difference. There are many implications about speed, memory usage, how much it looks and behaves like other programs on the same OS, how much it looks and behaves the same on all platforms. People disagree on some of these. Heavy vs light and whether to draw lightweight widgets in native code like Swing or in Java like SWT are contentious topics.
One addition to the description above ... a lightweight widget must sit on a heavyweight widget to get any drawing done, so you can't avoid heaveyweight stuff entirely. But a heavyweight panel can contain many lightweight widgets for a significantly lighter whole.
A good question is never answered. It is not a bolt to be tightened into place but a seed to be planted and to bear more seed toward the hope of greening the landscape of the idea. John Ciardi
In addition, since the light-weight components are drawn within java, their look and fell can be customised and these components appear the same across platforms(different OSes etc), but since heavyweight components depend on the OS, their look and feel changes across OSes.
The soul is dyed the color of its thoughts. Think only on those things that are in line with your principles and can bear the light of day. The content of your character is your choice. Day by day, what you do is who you become. Your integrity is your destiny - it is the light that guides your way. - Heraclitus
Heavy–weight components were the original java components and include classes like Component, Container, Panel, Label, ScrollPane and Checkbox. They are referred to as the AWT (Abstract Window Toolkit). Light–weight components came later, are referred to as Swing and include classes like JComponent, JPanel, JLabel; all preceeded by a 'J'.
It is best not to mix them together.
Custom painting is different in each system.
Swing offers a lot more variety in components and their customization.
Whatever you say buddy! And I believe this tiny ad too: