Mouse cursor/pointer problem

Hi,

In the past I have changed the mouse pointer in Swing and AWT apps with the following bit of code

Toolkit tk = Toolkit.getDefaultToolkit();
Cursor hand = tk.createCustomCursor(tk.getImage("Mouse.gif"), new Point(0, 0), "BlahBlah");
canvas.setCursor(hand);

This doesn’t work with a Xith3D Canvas3D, I’m not getting any error it’s simply ignores my new mouse pointer. The JOGL forum implies this method should work for a GLCanvas http://www.java-gaming.org/cgi-bin/JGNetForums/YaBB.cgi?board=jogl;action=display;num=1085725562;start=2

Any clues on changing the mouse cursor with Xith3D (Canvas3D class), if this can’t be done it’s a bit of a nail in the coffin for my project. turning off the cursor would be a start…

Thanks
Ben

Solved it !

All it needed was to call setCursor on the component of the CanvasPeer, bit of a guess but it worked!

Assuming CanvasPeer is called “canvas_peer”

        
Toolkit tk = Toolkit.getDefaultToolkit();
Cursor cursor = tk.createCustomCursor(tk.getImage("flask.png"), new Point(0, 0), "blah");
canvas_peer.getComponent().setCursor(cursor);

Ben

Hi,

Canvas3D compatibility with AWT component is left due to historical reasons (and maybe we have to factor it out at all? [I mean dependency on awt component]). Canvas3D itself never added to containers, so using CanvasPeer.getComponent() is a correct way of how to access GUI-library-dependent rendering component.

Yuri