Stopping java from changing the cursor?

J

Jon

Hiya

I have written java app which embeds a (Windows) C++ using JNI. The C++ code
uses a heavyweight Canvas object to display itself (basically it creates its
window using the Canvas's hWnd as a parent).

The application works absolutely fine, but I've run into an issue with cursors.
The C++ app defines its own cursor which is displayed when the mouse is over
its part of the display. However, when the java app updates its status bar (a
JLabel) using setText(), the cursor will immediately change to the java app's
default - even if the mouse pointer is still over the C++ display. Moving the
cursor a few pixels restores the C++ app's cursor.

This seems like broken behaviour to me - is there any way to stop it from
happening? Making the java and C++ cursors the same would be a workaround, but
it's not idea for this application.

Thanks,

Jon
 
R

Roedy Green

I have written java app which embeds a (Windows) C++ using JNI. The C++ code
uses a heavyweight Canvas object to display itself (basically it creates its
window using the Canvas's hWnd as a parent).


Your tool is setCursor. You would have to arrange to set the cursor
back to what you want any time it gets changed away from what you
want.

Consider than Java cursors are multiplatform, not interchangeable with
C++ cursors.

see http://mindprod.com/jgloss/cursor.html
--
Roedy Green Canadian Mind Products
http://mindprod.com

Microsoft has a new version out, Windows XP, which according to everybody is the "most reliable Windows ever." To me, this is like saying that asparagus is "the most articulate vegetable ever."
~ Dave Barry
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,769
Messages
2,569,582
Members
45,057
Latest member
KetoBeezACVGummies

Latest Threads

Top