JDK-8162856 : JSlider thumb is twice smaller on HiDPI display
  • Type: Bug
  • Component: client-libs
  • Sub-Component: javax.swing
  • Affected Version: 9
  • Priority: P3
  • Status: Resolved
  • Resolution: Fixed
  • Submitted: 2016-08-01
  • Updated: 2016-08-25
  • Resolved: 2016-08-09
The Version table provides details related to the release that this issue/RFE will be addressed.

Unresolved : Release in which this issue/RFE will be addressed.
Resolved: Release in which this issue/RFE has been resolved.
Fixed : Release in which this issue/RFE has been fixed. The release containing this fix may be available for download as an Early Access Release or a General Availability Release.

To download the current JDK release, click here.
JDK 9
9 b133Fixed
Related Reports
Relates :  
Description
Run the code below. The JSlider thumb is twice smaller:
--------------
import java.awt.FlowLayout;
import javax.swing.JFrame;
import javax.swing.JPanel;
import javax.swing.JSlider;
import javax.swing.SwingUtilities;
import javax.swing.UIManager;
import javax.swing.plaf.metal.MetalLookAndFeel;

public class JSliderTest {

    public static void main(String[] args) {

        System.setProperty("sun.java2d.uiScale", "2");

        SwingUtilities.invokeLater(() -> {

            try {
                UIManager.setLookAndFeel(new MetalLookAndFeel());
            } catch (Exception e) {
                throw new RuntimeException(e);
            }
            JFrame frame = new JFrame();
            frame.setSize(300, 300);
            frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);

            JPanel panel = new JPanel(new FlowLayout());
            JSlider slider = new JSlider();

            panel.add(slider);

            frame.getContentPane().add(panel);
            frame.setVisible(true);
        });
    }
}
--------------
Comments
Webrev: http://cr.openjdk.java.net/~alexsch/8162856/webrev.00/ Review thread: http://mail.openjdk.java.net/pipermail/swing-dev/2016-August/006443.html
02-08-2016