Skip to content

Instantly share code, notes, and snippets.

@ny83427 ny83427/
Created Jan 18, 2019

What would you like to do?
Double Buffer Avoid Flashing
private Image bgImage;
public void update(Graphics g) {
if (bgImage == null) bgImage = this.createImage(WIDTH, HEIGHT);
Graphics bg = bgImage.getGraphics();
bg.fillRect(0, 0, WIDTH, HEIGHT);
protected void paintComponent(Graphics g) {
// painting stuff
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.