I have a button in my scene where when clicked, the cursor changes to a crosshair and the user can select an X, Y location on the screen with a mouse click, then the cursor changes back. For this, I am using
scene.setCursor(Cursor.CROSSHAIR); //Change cursor to crosshair
scene.setCursor(Cursor.DEFAULT); //Change cursor to default
The problem is, once the mouse is dragged away from the frame, it changes back to default. It only stays as a crosshair when it is within the window. I understand that in Java it is impossible to interact with things outside of the frame, which is why I am using JNativeHook for my mouse listeners in this project. With this, is there a way to change the global cursor?