}
private void renderVolatileImage(BufferedImage bufferedImage) {
do {
int w = bufferedImage.getWidth(), h = bufferedImage.getHeight();
GraphicsConfiguration gc = getGraphicsConfiguration();
if (volatileImage == null || volatileImage.getWidth() != w
|| volatileImage.getHeight() != h
|| volatileImage.validate(gc) == VolatileImage.IMAGE_INCOMPATIBLE) {
if (volatileImage != null) {
volatileImage.flush();
}
volatileImage = gc.createCompatibleVolatileImage(w, h);
volatileImage.setAccelerationPriority(1.0f);
}
//
// Now paint the BufferedImage into the accelerated image
//