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 :
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