Seeking advice 'bout mouse cursors...

Hi lads!

So I have this OpenGL Display embedded inside a JFrame, and within the Display I’m showing, (very basic) UI elements. So far so good, everything works fine. However, I would like to change the cursor from [icode]java.awt.Cursor.DEFAULT_CURSOR[/icode] to [icode]java.awt.Cursor.HAND_CURSOR[/icode] when hovering above buttons, because that’s a lot nicer (notice I used the AWT Cursor fields, but I’m not necessarily looking for a solution involving those).

At first I tried to call [icode]javax.swing.JComponent.setCursor()[/icode] on the parent [icode]JFrame[/icode] every time the mouse moves to or out of a button… You’d think that would work, but it turns out the cursor keeps flickering between default and hand — I’m guessing that’s because of OpenGL messing with Swing ::slight_smile:

Of course, I guess I could just hide the cursor and draw another image at the mouse position, but that does not sound very pretty, now does it? :persecutioncomplex:

So yeah if someone actually knows how to handle cursors on top of OpenGL Displays that would be great!

J0 :slight_smile:

I’d not use the default cursors, at least in games. Disable the cursor completely, and draw your own cursor, with a custom texture.

Woah, that was quick! :smiley:
So is there no way to do what I was looking for?
I really don’t want a custom texture :persecutioncomplex: