This is the mail archive of the java-discuss@sourceware.cygnus.com mailing list for the Java project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Re: AWT


Per Bothner wrote:
> In the context of Java toolkits, my understanding is that "lightweight"
> means that the Java toolkit does most of the drawing, rather than
> delegating it to an lower-level toolkit (such as Motif or the Windows
> API).  "Heavyweight" means that the widget uses "native" widgets -
> i.e. it delegates drawing to some lower-level toolkit.  But the
> lower-level toolkit still has to invoke a lot of low-level drawing
> operations.  The X protocol does not provide "widgets";  they are
> a pure library thing.  (There is an implementation issue how many
> X server windows a toolkit uses, sometimes referred to the gadget
> vs widget distinction, which a gadget is a logical widget that
> does not correspond to an actual window the server knows about.
> But that is again not inherently a propery of lightweight vs
> heavyweight toolkits.)

Actually I think it is... "lightweight" widgets in AWT are those that
extends Component or Container.  "Heavyweight" widgets extend Panel or
Canvas, or one of the other native widgets.  The chief characteristic of
heavyweight widgets in the AWT is the native window associated with
them, not whether the widget code is implemented in native code or Java.

I haven't seen any real performance degradation with heavyweight AWT
components until a container has hundreds or thousands of heavyweight
components... for some reason, both Win32 and Motif widgets seem to
choke when they reach some critical mass.  I observed this back in the
good ol' 1.0 days when I was laying out large arrays of Button widgets
for a certain project.

 
-- 
Jeff Sturm
jsturm@sigma6.com

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]