Java - Canvas blinks when redrawing screen

0

I'm doing a graphical application with the Component class, but every time I delete the canvas to draw a new frame, Canvas flickers!

The clearBackground function:

public void clearBackground() {
    Graphics g = bs.getDrawGraphics();
    g.drawImage(background, 0, 0, null);
    g.dispose();
    bs.show();
}

background is white, but it blinks, and I've done everything to solve the problem, but every time it renders, the Canvas flashes, but sometimes it goes blank, and soon after you return! What can I do to solve the problem?

    
asked by anonymous 23.02.2017 / 14:43

0 answers