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

meaning of lightweight?

Jothi Pandyan

Joined: Sep 11, 2000
Posts: 11
what does lightweight (components) mean
what are its advantages
thanks in advance.
Peter Lyons
Ranch Hand

Joined: Sep 12, 2000
Posts: 202
I'd try to paraphrase what I've picked up in reading, but I'm not sure I get it either.
Check out this article.
Ranch Hand

Joined: Nov 22, 2008
Posts: 18944
Lightweight components are those without peer windows in the host system. Heavyweight components, even simple things like buttons, each have a corresponding window in the underlying OS.
This has implications for the capabilities and behavior of components. For instance, when you click on a heavyweight component, the window in the OS gets the click event and sends it to the VM. When you click on a lightweight component, the click falls through to the first heavyweight component (usually a JFrame), which must then decide which lightweight was actually clicked, and call its event handler. Another difference is that lightweight components may have transparent areas. It's true that some OS's windowing systems allow transparency, but the native code behind the AWT doesn't use it, so your only alternative for non-rectangular buttons and the like is to use lightweight components.
Because they are implemented entirely in Java, lightweight components are far more flexible. You can control their appearance and event handling to a far greater degree than heavyweights, which depend on the native code that supports the AWT.
I agree. Here's the link:
subject: meaning of lightweight?
It's not a secret anymore!