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).
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).
- relates to
-
JDK-8158776 [hidpi] The hotspot of the custom cursor isn't correct
-
- Closed
-