Wednesday, June 6, 2007

Z-ORDER IN SWING.

Z-ORDER IN SWING.

According to the api, swing components are lightweight. On the other hand AWT components are heavyweight. The difference between the two terms is z-order i.e the notion of depth or layering.

A heavyweight component occupies its own z-order layer while all lightweight components are contained inside heavyweight components and maintain their own layering scheme as defined by swing. If a heavyweight container is placed inside another heavyweight container, it will, by definition, overlap all lightweights in that container. Therefore, avoid using both heavyweight and lightweight components in the same container wherever possible. Although they can both be mixed one has to be careful while doing so.

Note though that:
1.you should not place heavyweight components inside lightweight containers that commonly support overlapping children.
2.If using popup menus in a container holding a heavyweight component, force that popup to be heavyweight. On the other hand, swing has much functionality that makes the use of AWT heavyweight components really less useful.

One useful reason why swing is preferred over AWT is due to its platform independence. On the other hand there are swing container classes like JApplet, JDialog, JFrame and JWindow which are direct AWT class subclasses that are platform dependent.

2 comments:

Anonymous said...

This phrase is simply matchless :), very much it is pleasant to me)))

Anonymous said...

prmfdwm ugz tagmk women threesome

algze!

ifbsn niznod zqi nude porn stars