Chapter 11. Repaint Manager
SWING is a powerful and flexible toolkit. Most of the time, Swing does the right thing. However, there are situations when you need to outsmart Swing and change its default behavior. The RepaintManager
is a special class that lets you hook into Swing’s internals and that will prove to be very useful in this chapter to create advanced visual effects.
When Swing Gets Too Smart
Swing’s painting mechanism always attempts to repaint only what’s necessary. It paints only the regions of those components that need to be repainted. This is very useful from a performance perspective but can hinder some particular visual effects.
To highlight the problem that might arise with Swing, let’s examine the example of the project called ...
Get Filthy Rich Clients: Developing Animated and Graphical Effects for Desktop Java™ Applications now with the O’Reilly learning platform.
O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.