public void paint(Graphics g){
  if (isOpaque()) {
    Rectangle r=g.getClipBounds();
    Color c=getBackground();
    if (c == null)     c=Color.lightGray;
    g.setColor(c);
    if (r != null) {
      g.fillRect(r.x,r.y,r.width,r.height);
    }
 else {
      g.fillRect(0,0,getWidth(),getHeight());
    }
  }
  super.paint(g);
}

public void paint ( Graphics g ) { if ( isOpaque ( ) ) { Rectangle r = g . getClipBounds ( ) ; Color c = getBackground ( ) ; if ( c == null ) c = Color . lightGray ; g . setColor ( c ) ; if ( r != null ) { g . fillRect ( r . x , r . y , r . width , r . height ) ; } else { g . fillRect ( 0 , 0 , getWidth ( ) , getHeight ( ) ) ; } } super . paint ( g ) ; }
paints this jlayeredpane within the specified graphics context .
