Why can not I mix AWT and Swing?
4566 Since 25th November, 2003
Select and Copy the Code
There are findamental incompatibilities in the way they draw themselves.
AWT java classes are not "pure" Java classes, they use underlaying C/C++ native code (dependable on
operation system) that can cause different appearence in different OSs.
Swing is pure Java implementation and has no native code at all. Swing applications look the same.
> If there is a problem mixing swing and awt... what are the results,
> what can happen?
Some objects drawn on top of others are not properly occluded. This is most obvious with drop down
menus, which have a tendency to stay visible even after you have selected a menu item. Another
problem is that if you use AWT components on a JTabbedPane they will not disappear when you switch
tabs. There are many similar issues.