I recommend reading Painting in AWT and Swing if you havenβt.
I donβt think you usually need Do-It-Yourself double buffering if you use JFrame. Swing has built-in double buffering, which is enabled by default. Manually doing it yourself will simply slow down the job. You can check if double buffering is enabled by calling isDoubleBufferingEnabled () on any of your JComponents.
There are times when you can do it yourself, but this should be the exception rather than the rule. Maybe you are doing something like writing a game, and in this case, perhaps my advice is not applicable. In any case, I hope this is useful information.
source share