There are no huge architectural differences between Swing and AWT. The class hierarchy is almost the same in the two packages. The reason for this is that Swing is built upon AWT.

The most significant difference is how the components are drawn to the screen. AWT is constructed with so-called “heavyweight components” – they have their own viewports, which send output to the screen. Swing is constructed of so-called “lightweight components”  – they do not write themselves to the screen, but redirect output to the underlying components upon which Swing is built. Heavyweight components have their own z-ordering. This is the reason why you can’t combine AWT and Swing in the same container. If you do, AWT always will be drawn on top of the Swing components.

You can combine AWT and Swing  – just don’t do it in the same container (e.g., panel, frame, groupbox, etc.) and don’t put a heavyweight component inside a lightweight one.

Another difference is that Swing is pure Java, and therefore it is platform independent. Swing should appear identically on all platforms, while AWT may appear differently on different platforms.

- Bary -

File: SwingVsAWT.rtf