void (Graphics g) { Graphics2D g2 = (Graphics2D)g.create(); try { Rectangle2D coloredTrack, scaleRect; int tw = JBUIScale.scale(1); if (slider.getOrientation() == SwingConstants.HORIZONTAL) { coloredTrack = new Rectangle2D.Double(trackRect.x - thumbRect.width / 2, trackRect.y + trackRect.height - JBUIScale.scale(10), thumbRect.x - trackRect.x + thumbRect.width, tw); scaleRect = new Rectangle2D.Double(thumbRect.x + thumbRect.width / 2, trackRect.y + trackRect.height - JBUIScale.scale(10), trackRect.x + trackRect.width - thumbRect.x - tw, tw); } else { coloredTrack = new Rectangle2D.Double(trackRect.x + thumbRect.width - JBUIScale.scale(10), trackRect.y - thumbRect.height / 2, tw, thumbRect.y - trackRect.y + thumbRect.height); scaleRect = new Rectangle2D.Double(trackRect.x + thumbRect.width - JBUIScale.scale(10), thumbRect.y + thumbRect.height / 2, tw, trackRect.y + trackRect.height - thumbRect.y - tw); } g2.setColor(getSliderColor()); g2.fill(coloredTrack); Color scaleColor = UIManager.getColor(slider.isEnabled() ? "Button.intellij.native.borderColor" : "Slider.disabledForeground"); g2.setColor(scaleColor); g2.fill(scaleRect); } finally { g2.dispose(); } }