int yPos = yPositionForValue(slider.getValue()); int y = (slider.getInverted() ? trackY : yPos); int h = (slider.getInverted() ? yPos - trackY : trackY + trackH - yPos); g.setColor(MetalLookAndFeel.getControlShadow()); g.fillRect(trackX + 1, y + 1, getTrackWidth() - 3, h - 3); if (slider.isEnabled()) { g.setColor(MetalLookAndFeel.getControl()); g.drawLine(trackX + 1, y + 1, trackX + trackW - 3, y + 1); g.drawLine(trackX + 1, y + 1, trackX + 1, y + h - 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);    }  }