If I have a bunch of custom JComponents in a Swing panel, and each of them can contain many other JComponents, is there a way to "freeze" repaints on the top level components and then unfreeze them, triggering a repaint?
I guess I am trying to do sort of a localized double-buffering.
Also, just in case the reason you're doing this is because you are doing a bunch of GUI updates to components and are worrying about all of those automatically posted repaints(), don't. repaint() does not paint immediately, it posts a deferred repaint event to the AWT event queue, which will coalesce multiple repaints for a given region to avoid doing the same painting over and over.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With