• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

A few problems with the Custom Cursor

 
Ranch Hand
Posts: 176
Mac Chrome Windows
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Howdy folks,

I'm trying to get some good custom cursors up and running but I'm not into a few problems.

Firstly, I use createCustomCursor to create my cursors but I notice it doesn't allow you to define the type of cursor (kind of like how Cursor(int) lets you do). This is annoying because I want to create cursors which have to origin at the center rather at top-left corner, like with a move or crosshair cursor instead of an arrow pointer. Right now my custom move has the origin on the top-left corner, which makes it feel very odd. How can a tweak my custom cursors to do this?

Also I've noticed that the Cursors are much too large on Windows whereas they're just fine on Mac OS X. How can I fix this without tampering the Mac version? NOTE: I'm using 256x256 images which I resize to 16x16 in getIcon(Icon, int). Is this a bad idea? You save them into separate 16x16 files instead?

Here's the code (it's kind of long-ish, line 104-133 are what's important though)


Thanks
 
Olivier Legat
Ranch Hand
Posts: 176
Mac Chrome Windows
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Ok I think I know how to fix the first problem actually

I've added this method:


Could someone please confirm to me that the "hotPoint" is essentially the origin of the cursor?
 
Sheriff
Posts: 22781
131
Eclipse IDE Spring VI Editor Chrome Java Windows
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
The hotpoint is the point (x,y) inside the image that will determine the point of the MouseEvent when you click somewhere. I don't know if that's what you meant with "origin".
 
reply
    Bookmark Topic Watch Topic
  • New Topic