Nin hao

A heavyweight component is one that has a native 'peer' component
directly associated with it. All the original AWT components were (and
still are) heavyweight, because for each one there's a corresponding
Windows, MacOS, Motif (etc.) widget, which is what you see on the
screen. Heavyweight widgets are always opaque, i.e. they completely
obscure their parents and any siblings which are 'below' them in the Z
ordering.

Lighweight components don't have a native peer widget. They simply
represent an area on some ancestor component, and they are drawn
entirely using Java code, with no help from the underlying OS.
Lighweight components can be transparent, i.e. some or all of the
components 'behind' the component show through, depending on which parts
of the component is drawn. Note that if you go up the ancestor chain of
a lightweight component, eventualy you will reach a heavyweight
component. This is the component that provides the drawing area for all
of its descendant lighweight components.

All Swing components are lighweight, as are any of your own that you
derive from 'J' components, or indeed from Component itself.

Hope this helps,
Zai jian,
Pete

#YANG YUE XIANG# wrote:
> 
> Hi,
> 
> Who can give me some information about what is Lightweights and
> HeavyWeighs component. Because my native language is not English,
> I am afraid that I have some misunderstand on the two concepts.
> Please give me a simple way to explain the two concepts!!!
> 
> Thanks ahead!
> 
> Yang Yue xiang
> =====================================================================
> To subscribe/unsubscribe, send mail to [EMAIL PROTECTED]
> Java 2D Home Page: http://java.sun.com/products/java-media/2D/

-- 
Pete Cockerell
California, USA
<http://www.best.com/~petec>
=====================================================================
To subscribe/unsubscribe, send mail to [EMAIL PROTECTED]
Java 2D Home Page: http://java.sun.com/products/java-media/2D/

Reply via email to