private void horizontalShade(Graphics g, JComponent c, boolean darkerToRight)
  {
    int width = c.getWidth();
    int height = c.getHeight();
    if(width > 255 * 2)
    {
      return; // exceedingly wide component not supported
    }
    Border bo = c.getBorder();
    int rim = 1;
    int left = rim;
    int top = rim;
    int right = rim;
    int bottom = rim;
    int d = 2;
    if(bo != null)
    {
      Insets ins = bo.getBorderInsets(c);
      left = ins.left;
      top = ins.top;
      right = ins.right;
      bottom = ins.bottom;
      d = 1;
    }

    int j = 0;
    int start = 255 - width / 2 > 0 ? 255 - width / 2 : 0;
    for(int i = left; i < width - right; i++)
    {
      if(true)
      {
        if(i % 2 == 0)
        {
          j++;
        }
        int s = darkerToRight ? 255 - j : start + j;
        g.setColor(new Color(s, s, s));
      }
      g.drawLine(i, top, i, height - bottom - d);

    }
  }