Jscrollpane not updating

25-Jun-2017 09:25

In an application-triggered painting operation, the component decides it needs to update its contents because its internal state has changed. a button detects that a mouse button has been pressed and determines that it needs to paint a "depressed" button visual).

Regardless of how a paint request is triggered, the AWT uses a "callback" mechanism for painting, and this mechanism is the same for both heavyweight and lightweight components.

The default implementation of simply looks through the children sequentially and tests for visibility and intersection -- an operation that may be unnecessarily inefficient with certain layouts.

For example, if a container layed out the components in a 100x100 grid, then that grid information could be used to determine more quickly which of those 10,000 components intersect the clip rectangle and actually need to be painted. Additionally, Swing provides built-in support for double-buffering as well as changes to support Swing's additional structure (like borders and the UI delegate).

This is how a system-triggered painting operation takes place: painting.

Incremental painting is useful if a program wishes to layer additional rendering on top of the existing bits of that component.

This is handled by to do incremental painting must ensure that lightweight descendents are recursively repainted if necessary.

This allowed the AWT to rely heavily on the paint subsystem in each native platform.

Both the AWT (abstract windowing toolkit) and Swing provide such a framework.

But the APIs that implement it are not well understood by some developers -- a problem that has led to programs not performing as well as they could.

This article explains the AWT and Swing paint mechanisms in detail.

Its purpose is to help developers write correct and efficient GUI painting code.

This allowed the AWT to rely heavily on the paint subsystem in each native platform. Both the AWT (abstract windowing toolkit) and Swing provide such a framework.But the APIs that implement it are not well understood by some developers -- a problem that has led to programs not performing as well as they could.This article explains the AWT and Swing paint mechanisms in detail.Its purpose is to help developers write correct and efficient GUI painting code.Consequently, there are subtle differences in how painting works for heavyweight and lightweight components.