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?
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?
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
Toolkit toolkit = Toolkit.getDefaultToolkit();
Image image = toolkit.createImage(new byte[]{0});
Cursor noCursor = toolkit.createCustomCursor(image, new Point(1,1),
"blank cursor");
setCursor(noCursor);