Which of this components are lightweight (with detail explanation)? # Canvas # Component # Container # Panel # JComponent
Roy Ben Ami
posted 13 years ago
as far as i know i think JComponent is the only lightweight one. Lightweight componenets are swing components that dont use the native operating system peers for displaying the controls (or widgets). all awt controls are heavy ones since they use the operating system to display the buttons, labels, checkboxes etc.... (thus they wil look different on different OS). swing componeents reinvented the wheel and they do everything themselves. thats why swing is slower than awt. notice however that heavy and light are just words to distinct the two. it doesnt mean anything about performance or usage. the only rule is that u cant mix the two.