Hide the mouse cursor: use a transparent GIF as the cursor : GIF « 2D Graphics GUI « Java






Hide the mouse cursor: use a transparent GIF as the cursor

   
import java.awt.Cursor;
import java.awt.Image;
import java.awt.Point;
import java.awt.Toolkit;
import java.awt.image.MemoryImageSource;

public class Main {
  public static void main(String[] argv) throws Exception {

    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");
  }
}

   
    
    
  








Related examples in the same category

1.GIF Writer
2.Class for converting images to GIF files
3.Animated Gif Encoder
4.Gif file Encoder
5.Gif Encoder
6.GIFEncoder is a class which takes an image and saves it to a stream using the GIF file format
7.AnimatedGifEncoder - Encodes a GIF file consisting of one or more frames
8.Converting GIF to PostScript
9.Decodes a GIF file into one or more frames
10.Gif Encoder implements ImageConsumer
11.Get Gif Properties
12.Gif Encoder - writes out an image as a GIF.