• Post Reply Bookmark Topic Watch Topic
  • New Topic

What are heavyweight components?

 
Rachel Swailes
Ranch Hand
Posts: 434
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi there.

I'm investigating using a JScrollPane to show a RenderedImage and I see in the API that it says...

"Note that JScrollPane does not support heavyweight components"

What are examples of heavyweight components?

Cheers,
Rachel
 
Joe Ess
Bartender
Posts: 9361
11
Linux Mac OS X Windows
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

When the original AWT API was developed for JDK 1.0, only heavyweight components existed ("heavyweight" means that the component has it's own opaque native window). This allowed the AWT to rely heavily on the paint subsystem in each native platform. This scheme took care of details such as damage detection, clip calculation, and z-ordering. With the introduction of lightweight components in JDK 1.1 (a "lightweight" component is one that reuses the native window of its closest heavyweight ancestor), the AWT needed to implement the paint processing for lightweight components in the shared Java code. Consequently, there are subtle differences in how painting works for heavyweight and lightweight components.

Painting in AWT and Swing
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!