FileDocCategorySizeDatePackage
DoubleBufferPanel.javaAPI DocExample996Wed Apr 19 11:21:46 BST 2000actual

DoubleBufferPanel

public class DoubleBufferPanel extends Panel

Fields Summary
Image
offscreen
Constructors Summary
Methods Summary
public voidinvalidate()
null out the offscreen buffer as part of invalidation

      super.invalidate();
      offscreen = null;
  
public voidpaint(java.awt.Graphics g)
paint children into an offscreen buffer, then blast entire image at once.

      if(offscreen == null) {
         offscreen = createImage(getSize().width, getSize().height);
      }

      Graphics og = offscreen.getGraphics();
      og.setClip(0,0,getSize().width, getSize().height);
      super.paint(og);
      g.drawImage(offscreen, 0, 0, null);
      og.dispose();
  
public voidupdate(java.awt.Graphics g)
override update to *not* erase the background before painting

      paint(g);