File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes Swing / AWT / SWT and the fly likes swing components Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Swing / AWT / SWT
Bookmark "swing components" Watch "swing components" New topic

swing components

tanvir rony

Joined: Feb 07, 2002
Posts: 3
Which of this components are lightweight (with detail explanation)?
# Canvas
# Component
# Container
# Panel
# JComponent
Roy Ben Ami
Ranch Hand

Joined: Jan 13, 2002
Posts: 732
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.
I agree. Here's the link:
subject: swing components
It's not a secret anymore!