if (translatedBg != null) { translatedBg.dispose(); }  translatedBg = bg.create(); translatedBg.translate(-bufferRect.x, -bufferRect.y);
    protected void setbackgroundBuffer(int w, int h) {        //backgroundBuffer = defaultConfiguration.createCompatibleImage(w, h);	if (backgroundBuffer != null) {	    backgroundBuffer.flush();	}        backgroundBuffer = defaultConfiguration.createCompatibleVolatileImage(w,                h);        bufferRect.height = backgroundBuffer.getHeight(null);        bufferRect.width = backgroundBuffer.getWidth(null);        if (bg != null) {            bg.dispose();        }        bg = backgroundBuffer.getGraphics();        if (translatedBg != null) {            translatedBg.dispose();        }        translatedBg = bg.create();        translatedBg.translate(-bufferRect.x, -bufferRect.y);        bg.clearRect(0, 0, w, h);        refreshBackground();    }