A Note About Mixing Swing and AWT Components

     

A Note About Mixing Swing and AWT Components

Swing components are lightweight. AWT components, now out of fashion, are heavyweight. That means that it is a bad idea to mix the older AWT components with Swing components. The reason is that you will get unpredictable behavior. More specifically , you will find that the AWT components will always force themselves in front of the sweet little lightweight Swing components. You could have serious trouble displaying a Canvas, for example, in tandem with a JPanel. Just something to beware of.

The designers of the Swing libraries learned a lot from working with AWT, and you should be able to find the components you need in the newer libraries without having to mix.

Disclaimer: The most popular book on Swing is 2 volumes and nearly 3,000 pages. We don't have room for much more. We are really touching the surface here, but this is enough to get started. As this book shows, you can make a number of interactive and GUI programs without going too far into layout managers, and after you have handled one action, you've handled them all.

 

 return; }//eof... ]^_^[ 



Java Garage
Java Garage
ISBN: 0321246233
EAN: 2147483647
Year: 2006
Pages: 228
Authors: Eben Hewitt

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net