I have a JFrame that contains 4 instances of ScrollPane, each with its own Canvas and BufferStrategy. When my drawing first takes place everything works as expected, but when I scroll in ScrollPane the graphics that are scrolled out of view are erased when I scroll them back into view.
I have a JFrame that contains 4 instances of ScrollPane , each with its
Share
Don’t use a Canvas and a ScrollPane. Use a JPanel and JScrollPane. Swing is double buffered by default.
Plus the code you posted has nothing to do with your custom painting so we can’t guess what you might be doing wrong.
Post your SSCCE after making the changes and if you need more help.