lightweight : Java Glossary

lightweight
You can create simple custom components by overriding a few methods of the official ones. These pure Java custom components are referred to as lightweights. They don’t have an associated GUI (Graphic User Interface) peer object. Since all the code is in Java, these components behave identically on different platforms. In contrast heavyweight components behave according to native GUI rules. Lightweights do their own drawing, based on something low-level like a canvas or panel. This gives them precise control over how they look and behave. Heavyweights use the native drawing facilities. Lightweights behave the same on all platforms. Heavyweights behave according to the local customs.

For example, Swing asks the underlying OS (Operating System) for a window of raw pixels, and Swing draws the various lightweight buttons, labels etc. on it. Swing does the analyis to figure out which component you clicked with your mouse. In contrast, AWT (Advanced Windowing Toolkit) asks the OS to draw individual heavyweight native buttons, labels etc. The OS mananges the GUI components and figures out which one you clicked.


CMP homejump to top You can get the freshest copy of this page from: or possibly from your local J: drive (Java virtual drive/mindprod.com website mirror)
http://mindprod.com/jgloss/lightweight.html J:\mindprod\jgloss\lightweight.html
logofeedback Please email your feedback for publication, letters to the editor, errors, omissions, typos, formatting errors, ambiguities, unclear wording, broken/redirected link reports, suggestions to improve this page or comments to Roedy Green : feedback email If you want your message kept confidential, not considered for posting, please explicitly specify that.
mindprod.com IP:[65.110.21.43]
view BlogYour face IP:[38.107.179.214]
You are visitor number 12,197.