Public paste
Undefined
By: Guest | Date: Jul 1 2010 10:29 | Format: None | Expires: never | Size: 413 B | Hits: 845

  1. public void update(Graphics g) {
  2.                 if (dbImage == null) {
  3.                         dbImage = createImage(this.getSize().width, this.getSize().height);
  4.                         dbg = dbImage.getGraphics();
  5.                 }
  6.                 dbg.setColor(getBackground());
  7.                 dbg.fillRect(0, 0, this.getSize().width, this.getSize().height);
  8.  
  9.                 dbg.setColor(getForeground());
  10.                 paint(dbg);
  11.  
  12.                 g.drawImage(dbImage, 0, 0, this);
  13.         }
  14.         private Image dbImage;
  15.         private Graphics dbg;