protected void createBackBuffer ( GraphicsConfiguration gc ) { // if we have an old image, clear it out if ( _backimg != null ) { _backimg . flush ( ) ; _bgfx . dispose ( ) ; } // create the offscreen buffer int width = _window . getWidth ( ) , height = _window . getHeight ( ) ; _backimg = gc . createCompatibleVolatileImage ( width , height ) ; // fill the back buffer with white _bgfx = ( Graphics2D ) _backimg . getGraphics ( ) ; _bgfx . fillRect ( 0 , 0 , width , height ) ; // clear out our frame graphics in case that became invalid for // the same reasons our back buffer became invalid if ( _fgfx != null ) { _fgfx . dispose ( ) ; _fgfx = null ; } // Log.info("Created back buffer [" + width + "x" + height + "]."); }
Creates the off - screen buffer used to perform double buffered rendering of the animated panel .