hide the cursor

hi all.. i'm developing a drawing application. i need to hide the cursor and change with the shape that is going to be drawn. Any idea how to hide the cursor?

[166 byte] By [don.juan9a] at [2007-11-27 11:34:08]
# 1

What you need to is make a new Cursor object then, on your Canvas/JFrame there's a method called setCursor(cursorObject); but for the cursor object you need to specify a transparent image. and Voila! cursor hidden. (Here's a link to the Cursor Class http://java.sun.com/javase/6/docs/api/) Cheers, and good luck!!

~Alan

PaRlOaGna at 2007-7-29 16:55:33 > top of Java-index,Security,Cryptography...
# 2

Toolkit toolkit = Toolkit.getDefaultToolkit();

Image image = toolkit.createImage(new byte[]{0});

Cursor noCursor = toolkit.createCustomCursor(image, new Point(1,1),

"blank cursor");

setCursor(noCursor);

crwooda at 2007-7-29 16:55:33 > top of Java-index,Security,Cryptography...