protected void paintGradient(Graphics g) {
    g = g.create();
    try {
      Color background = getViewColor();
      Component header = getHeader();
      if (header != null) {
        header.setBounds(0, 0, getWidth(), header.getPreferredSize().height);
        if (background != null) {
          g.setColor(background);
          g.fillRect(header.getX(), header.getY(), header.getWidth(), header.getHeight());
        }
      }
      if (g instanceof Graphics2D && background != null && !Registry.is("ui.no.bangs.and.whistles")) {
        paintGradient((Graphics2D)g, background, 0, header == null ? 0 : header.getHeight());
      }
      if (header != null) {
        header.paint(g);
      }
    }
    finally {
      g.dispose();
    }
  }
protected void paintGradient(Graphics g)