Can I set the cursor larger than 32x32 pixels?

Vikram Lele

You cannot change the cursor size arbitrarily. You can use Toolkit's method createCustomCursor, to create your own cursors from an image.

Toolkits implementation uses getBestCursorSize to get the nearest size supported by particular systems, and if you have used an image which has a size different from the value returned by this function, the image will be resized before using it as cursor.

To check if a system supports cursors larger than 32x32, you can get default toolkit, and call getBestCursorSize with the size that you want. If the system supports a larger size, it will return a larger value.

Comment and Contribute






(Maximum characters: 1200). You have 1200 characters left.