public void update(){
  if (bgIsOpaque) {
    int w=Math.max(getSize().width,minWidth);
    int h=Math.max(getSize().height,minHeight);
    offScr=createImage(w,h);
    if (offScr == null)     return;
    Graphics g=offScr.getGraphics();
    drawInto(g);
    repaint();
    g.dispose();
  }
 else {
    repaint();
  }
}

public void update ( ) { if ( bgIsOpaque ) { int w = Math . max ( getSize ( ) . width , minWidth ) ; int h = Math . max ( getSize ( ) . height , minHeight ) ; offScr = createImage ( w , h ) ; if ( offScr == null ) return ; Graphics g = offScr . getGraphics ( ) ; drawInto ( g ) ; repaint ( ) ; g . dispose ( ) ; } else { repaint ( ) ; } }
updates all changes in areas state and repaints component .
