@Override
  public void paintThumb(Graphics g) {
    Graphics2D g2 = (Graphics2D)g.create();
    try {
      g2.translate(thumbRect.x, thumbRect.y);

      Path2D thumb = new Path2D.Float(Path2D.WIND_NON_ZERO);

      if (slider.getOrientation() == SwingConstants.VERTICAL) {
        if (slider.getComponentOrientation().isLeftToRight()) {
          thumb.moveTo(0, 0);
          thumb.lineTo(thumbRect.width - JBUIScale.scale(4), 0);
          thumb.lineTo(thumbRect.width, thumbRect.height / 2);
          thumb.lineTo(thumbRect.width - JBUIScale.scale(4), thumbRect.height);
          thumb.lineTo(0, thumbRect.height);
        }
        else {
          thumb.moveTo(thumbRect.width, 0);
          thumb.lineTo(thumbRect.width, thumbRect.height);
          thumb.lineTo(JBUIScale.scale(4), thumbRect.height);
          thumb.lineTo(0, thumbRect.height / 2);
          thumb.lineTo(JBUIScale.scale(4), 0);
        }
      }
      else {
        thumb.moveTo(0, 0);
        thumb.lineTo(thumbRect.width, 0);
        thumb.lineTo(thumbRect.width, thumbRect.height - JBUIScale.scale(4));
        thumb.lineTo(thumbRect.width / 2, thumbRect.height);
        thumb.lineTo(0, thumbRect.height - JBUIScale.scale(4));
      }
      thumb.closePath();

      g2.setColor(getSliderColor());
      g2.fill(thumb);
    }
    finally {
      g2.dispose();
    }
  }
@Override
  public void paintThumb(Graphics g)