public static void fillRectange(Graphics2D g2D,JComponent c,boolean round){
  CompiereColor cc=null;
  boolean stdCC=c.getClientProperty(CompiereLookAndFeel.BACKGROUND_FILL) != null;
  try {
    cc=(CompiereColor)c.getClientProperty(CompiereLookAndFeel.BACKGROUND);
  }
 catch (  Exception e) {
    stdCC=true;
  }
  if (stdCC)   cc=CompiereColor.getDefaultBackground();
  if (cc != null) {
    cc.paint(g2D,c);
  }
 else {
    Paint paint=c.getBackground();
    g2D.setPaint(paint);
    RectangularShape rec=null;
    if (round)     rec=new RoundRectangle2D.Float(0,0,c.getWidth(),c.getHeight(),15,15);
 else     rec=new Rectangle(0,0,c.getWidth(),c.getHeight());
    g2D.fill(rec);
  }
}

public static void fillRectange ( Graphics2D g2D , JComponent c , boolean round ) { CompiereColor cc = null ; boolean stdCC = c . getClientProperty ( CompiereLookAndFeel . BACKGROUND_FILL ) != null ; try { cc = ( CompiereColor ) c . getClientProperty ( CompiereLookAndFeel . BACKGROUND ) ; } catch ( Exception e ) { stdCC = true ; } if ( stdCC ) cc = CompiereColor . getDefaultBackground ( ) ; if ( cc != null ) { cc . paint ( g2D , c ) ; } else { Paint paint = c . getBackground ( ) ; g2D . setPaint ( paint ) ; RectangularShape rec = null ; if ( round ) rec = new RoundRectangle2D . Float ( 0 , 0 , c . getWidth ( ) , c . getHeight ( ) , 15 , 15 ) ; else rec = new Rectangle ( 0 , 0 , c . getWidth ( ) , c . getHeight ( ) ) ; g2D . fill ( rec ) ; } }
fill background with color . ( ususlly called from update methods )
