JDK-8158205 : HiDPI hand cursor broken on Windows
  • Type: Bug
  • Component: client-libs
  • Sub-Component: java.awt
  • Affected Version: 8u92,9
  • Priority: P3
  • Status: Resolved
  • Resolution: Fixed
  • OS: windows_7
  • Submitted: 2016-05-31
  • Updated: 2016-08-04
  • Resolved: 2016-07-08
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 b130Fixed
Related Reports
Relates :  
Description
Using Java 8u92 in HiDPI mode, on Windows 7, the hand cursor looks pixely. It appears to be shown in the wrong resolution.

Using Java 9ea118 in HiDPI mode, on Windows 7, it's not possible to switch to the hand cursor (using the code below). The regular cursor is shown.

The same code works fine in standard DPI mode using either Java 8 or 9.

Code:

import javax.swing.*;
import java.awt.*;

public class HandCursorTest {

    public static void main(final String[] args) {
        final JFrame frame = new JFrame();
        frame.setDefaultCloseOperation(WindowConstants.EXIT_ON_CLOSE);
        SwingUtilities.invokeLater(() -> {
            frame.setBounds(200, 200, 200, 200);
            frame.getContentPane().setCursor(Cursor.getPredefinedCursor(Cursor.HAND_CURSOR));
            frame.setVisible(true);
        });
    }
}

Reproduce
Run the code on a Windows 7 computer in HiDPI mode and move the mouse cursor over the window.

Expected
The mouse cursor should change the to the pre-defined Hand cursor using the system resolution.

Actual
8u92: Wrong resolution Hand cursor image.
9ea118: Cursor does not change.

The failure may also occur on Windows 8 and 10 (untested).
Comments
Hey Rajeev, it would be great, if this fix was back ported to Java 8. Thank you.
12-07-2016