lightweight : Java Glossary

go to home page L words local find full screen, hide local find menu Google search web for more information on this topic jump to foot of page translate this page with Babelfish punctuation 0-9 A B C D E F G H I J K L M N O P Q R S T U V W X Y Z (all) ©1996-2009 Roedy Green, Canadian Mind Products
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 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 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 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
CMP logofeedback Please email your feedback for publication, errors, omissions, typos, formatting errors, ambiguities, unclear wording, broken/redirected link reports, suggestions to improve this page or comments to Roedy Green : feedback email
mindprod.com IP:[65.110.21.43]
view BlogYour face IP:[38.107.191.106]
You are visitor number 10,463.