int xPos = xPositionForValue(slider.getValue()); int x = (slider.getInverted() ? xPos : trackRect.x); int w = (slider.getInverted() ? trackX + trackW - xPos : xPos - trackRect.x); g.setColor(MetalLookAndFeel.getControlShadow()); g.fillRect(x + 1, trackY + 1, w - 3, getTrackWidth() - 3); if (slider.isEnabled()) { g.setColor(MetalLookAndFeel.getControl()); g.drawLine(x + 1, trackY + 1, x + w - 3, trackY + 1); g.drawLine(x + 1, trackY + 1, x + 1, trackY + getTrackWidth() - 3); }
  public void paintTrack(Graphics g)  {    if (slider.getOrientation() == JSlider.HORIZONTAL)    {      if (filledSlider)       {        // TODO: fill the track      }      BasicGraphicsUtils.drawEtchedRect(g, trackRect.x, trackRect.y           + (trackRect.height - getTrackWidth()) / 2, trackRect.width - 1,           getTrackWidth(), Color.darkGray, Color.gray, Color.darkGray,           Color.white);    }    else    {      if (filledSlider)       {        // TODO: fill the track      }      BasicGraphicsUtils.drawEtchedRect(g, trackRect.x  + (trackRect.width           - getTrackWidth()) / 2, trackRect.y, getTrackWidth(),           trackRect.height - 1, Color.darkGray, Color.gray, Color.darkGray,           Color.white);    }  }