Java 2d graphics paint flicker when updating