Trying to hide the cursor with JDK1.5.0 on linux, I get
Exception in thread “main” java.lang.ExceptionInInitializerError
at apollo.Surface.(Surface.java:59)
at test.TestLevel.run(TestLevel.java:69)
at test.TestLevel.main(TestLevel.java:54)
Caused by: java.lang.IndexOutOfBoundsException: invalid hotSpot
at sun.awt.CustomCursor.(CustomCursor.java:61)
at sun.awt.X11CustomCursor.(X11CustomCursor.java:26)
at sun.awt.X11.XCustomCursor.(XCustomCursor.java:27)
at sun.awt.X11.XToolkit.createCustomCursor(XToolkit.java:742)
at apollo.CursorManager.createInvisibleCursor(CursorManager.java:68)
at apollo.CursorManager.(CursorManager.java:37)
… 3 more
The code looks like this:
private static Cursor createInvisibleCursor()
{
// Create the invisible cursor
MemoryImageSource memIm = new MemoryImageSource(1, 1, new int[] { 0 }, 0, 1);
Component c = new Component() { };
Image im = c.createImage(memIm);
Point spot = new Point(1, 1);
return c.getToolkit().createCustomCursor(im, spot, INVISIBLE_CURSOR_NAME);
}
Has anybody experienced the same problem ? Any solution ?