JDK-8139152 : Toolkit.createCustomCursor() provides no way to produce retina-quality cursors
  • Type: Enhancement
  • Component: client-libs
  • Sub-Component: java.awt
  • Affected Version: 8u60
  • Priority: P4
  • Status: Resolved
  • Resolution: Fixed
  • OS: windows_7
  • CPU: x86_64
  • Submitted: 2015-10-07
  • Updated: 2020-03-05
  • Resolved: 2015-10-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 b83Fixed
Related Reports
Relates :  
Relates :  
Relates :  
Relates :  
Description
A DESCRIPTION OF THE REQUEST :
There doesn't seem to be any way to provide retina-quality images for custom cursors on Mac retina systems. There should probably be an additional Toolkit.createCustomCursor() method that takes a scale parameter or size parameters, so the image size can differ from the nominal cursor size (be double sized on retina).


JUSTIFICATION :
Custom cursors on Mac retina systems are not as smooth as they could be.



Comments
JDK 9 provides java.awt.image.MultiResolutionImage interface that allows to create a set of images with different resolution variants (see JDK-8046010) Here is a simple example hot to use it with custom cursor: ------------ BaseMultiResolutionImage mrImage = new BaseMultiResolutionImage(image, image2x); Cursor cursor = Toolkit.getDefaultToolkit().createCustomCursor(mrImage, new Point(10, 10), "High-resolution Cursor"); ------------ JDK 8 allows to create a multi-resolution image using the Toolkit.getImage() method (see JDK-8011059): ------------ // put mage.png and mage@2x.png to <path-to-images> folder final Image mrImage = Toolkit.getDefaultToolkit().getImage("<path-to-images>/image.png"); Cursor cursor = Toolkit.getDefaultToolkit().createCustomCursor(mrImage, new Point(10, 10), "High-resolution Cursor"); ------------
09-10-2015

To Dev for evaluation.
08-10-2015