Jump to Real's How-to Main page

Hide the mouse cursor

One way is to use a transparent GIF as the cursor or create one.
int[] pixels = new int[16 * 16];
Image image = Toolkit.getDefaultToolkit().createImage(
        new MemoryImageSource(16, 16, pixels, 0, 16));
Cursor transparentCursor =
        Toolkit.getDefaultToolkit().createCustomCursor
             (image, new Point(0, 0), "invisibleCursor");

If you find this article useful, consider making a small donation
to show your support for this Web site and its content.

Written and compiled by Réal Gagnon ©1998-2005
[ home ]