aspose file tools*
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
Author

meaning of lightweight?

Jothi Pandyan
Greenhorn

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. http://java.sun.com/products/jfc/tsc/articles/mixing/index.html
Anonymous
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.
 
Consider Paul's rocket mass heater.
 
subject: meaning of lightweight?