base/common/src/main/com/thesett/common/swing/surface/Surface.java
public void paintImmediately(int x, int y, int w, int h)
    {
        RepaintManager repaintManager = null;
        boolean save = true;

        if (!isDoubleBuffered())
        {
            repaintManager = RepaintManager.currentManager(this);
            save = repaintManager.isDoubleBufferingEnabled();
            repaintManager.setDoubleBufferingEnabled(false);
        }

        super.paintImmediately(x, y, w, h);

        if (repaintManager != null)
        {
            repaintManager.setDoubleBufferingEnabled(save);
        }
    }
public void paintImmediately(int x, int y, int w, int h)
    {
        RepaintManager repaintManager = null;
        boolean save = true;

        if (!isDoubleBuffered())
        {
            repaintManager = RepaintManager.currentManager(this);
            save = repaintManager.isDoubleBufferingEnabled();
            repaintManager.setDoubleBufferingEnabled(false);
        }

        super.paintImmediately(x, y, w, h);

        if (repaintManager != null)
        {
            repaintManager.setDoubleBufferingEnabled(save);
        }
    }
public void paintImmediately ( int x , int y , int w , int h ) { RepaintManager repaintManager = null ; boolean save = true ; if ( ! isDoubleBuffered ( ) ) { repaintManager = RepaintManager . currentManager ( this ) ; save = repaintManager . isDoubleBufferingEnabled ( ) ; repaintManager . setDoubleBufferingEnabled ( false ) ; } super . paintImmediately ( x , y , w , h ) ; if ( repaintManager != null ) { repaintManager . setDoubleBufferingEnabled ( save ) ; } }
Immediately repaints the surface.

<p/>It's possible to turn off double-buffering for just the repaint calls invoked directly on the non double
buffered component. This can be done by overriding paintImmediately() (which is called as a result of repaint)
and getting the current RepaintManager and turning off double buffering in the RepaintManager before calling
super.paintImmediately(g).

@param x The X coord to start painting at.
@param y The Y coord to start painting at.
@param w The width of the region to paint.
@param h The height of the region to paint.
Immediately repaints the surface .