To set the cursor invisible, create a transparent image, then use the
Toolkit to create a custom cursor with that image.
// by leaving the int array as zeros, the image will be transparent
Image img = createImage(new MemoryImageSource(1, 1, new int[2], 0, 0));
Toolkit kit = Toolkit.getDefaultToolkit();
Cursor cursor = kit.createCustomCursor(img, new java.awt.Point(0,0),
"Transparent");
setCursor(cursor);