Win a copy of Kotlin in Action this week in the Kotlin forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

Change Curser  RSS feed

 
Sameera Abeysinghe
Ranch Hand
Posts: 104
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi all,
I am coding a paint application. I need to change my mouse curser. If I have selected the pencil tool and when the curser is on top of the paint area I need my curser to look as a pencil. So I was thinking I will give a small pencil image when the curser is on top of my paint area. But I don�t know how to do it.
Is it possible? If yes then how?
If I can�t give an image to it how can I change the curser? (Need something other that the cursers in java.awt.Curser class)

Thank a lot.

Thanks a lot. it seems it will work.

but i got a nother problem.
public Cursor createCustomCursor(Image cursor,Point hotSpot,String name);
i can create a Image object(it is abstract). and if i create a BufferedImage object where i have to give the image
pleace help me

thanks a lot for your help
[ July 27, 2005: Message edited by: Sameera Abeysinghe ]
 
David Weitzman
Ranch Hand
Posts: 1365
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Check out the createCustomCursor() method in Toolkit
 
David Weitzman
Ranch Hand
Posts: 1365
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You can use Toolkit.getDefaultToolkit().getImage() to fetch the image if it's a .gif, .png, or .jpg
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!