The class javax.swing.CellRendererPane “is inserted in between cell renderers and the components that use them” and “just exists to thwart the repaint() and invalidate() methods which would otherwise propagate up the tree when the renderer was configured.”
That’s what the JavaDoc tells me, but what does it mean? How is it used, and what would happen if the repaint() and invalidate() were instead allowed to propagate up the tree? Concrete examples are particularly welcome.
It means it is inserted in the middle of the component tree (rooted in the top level window) and will eat certain events e.g. repaint & invalidate to prevent their propagation up the component containment hierarchy.
Why? Because repaint and invalidate are potentially expensive events to process; it is not necessary in this case; and a simple component (the pane) can trivially filter them.
If events were to propagate, then every component would needlessly recompute their layout (invalidate) and redraw (repaint) themselves.