• 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

Change Curser

 
Ranch Hand
Posts: 104
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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 ]
 
Ranch Hand
Posts: 1365
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Check out the createCustomCursor() method in Toolkit
 
David Weitzman
Ranch Hand
Posts: 1365
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
You can use Toolkit.getDefaultToolkit().getImage() to fetch the image if it's a .gif, .png, or .jpg
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
reply
    Bookmark Topic Watch Topic
  • New Topic