|
-
January 22nd, 1999, 02:43 PM
#1
JAVA: changing the cursor
From a post from Zafir Anjum regarding chaning the mouse cursor:
note that simply calling setCursor() doesn't actually change the cursor. The change is delayed till the next mouse click or movement.
This does indeed seem to be the case.
My question is should it then not be possible to turn around post a mouseEvent such as mouseMove. I have tried this by posting Directly to the EventQueue,
and by calling dispatchEvent on the object in question directly. But to no avail.
-
January 22nd, 1999, 04:43 PM
#2
Re: JAVA: changing the cursor
It should certainly be possible to force the change. You'd have to experiment a
little bit.
Meantime if you are not afraid to use undocumented / deprecated stuff here's a
much simple way of changing the cursor. Note: Make sure you use this only for
top level windows e.g. JFrame.
frame.getPeer().setCursor(Cursor.getPredefinedCursor(Cursor.WAIT_CURSOR));
This basically calls the native OS which affects the change immediately.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|