Hi everyone,
I have an application exported into an .exe which hides the cursor using noCursor(); and replaces it with another cursor (customized one)…
This works perfectly when it runs on my laptop, using only one monitor.
But this application must run in a 2nd monitor, and both monitors must share an extended desktop. I'm on a PC.
OK, I run the .exe and drag it to the 2nd monitor.
The problem comes here, in the moment that I “rollout” the application and “rollover” it again because, in that moment, the application doesn’t hide the cursor, and it shows both cursors: the one by default, and the customized one.
The interactivity continues there, it is: I can get mouseX and mouseY but I cannot hide the cursor: noCursor(); doesn’t work.
I highlight “rollout” and “rollover” because this problem doesn’t occur when I click outside the application and then click inside the application (it is, explicitly loosing and gaining the focus). Once I click on the application, it hides the cursor correctly.
I don’t know Java but still I’m trying these methods:
Code:
public void focusGained(java.awt.event.FocusEvent e) {
print("\ngained: "+e);
}
public void focusLost(java.awt.event.FocusEvent e) {
print("\nlost: "+e);
}
They are invoked when I click outside the application and then click inside the application. Good.
They are not invoked when I rollout and rollover the application.
Also I have tried these methods:
Code:
public void mouseEntered(java.awt.event.MouseEvent e) {
print("\nmouse Entered: "+e);
}
public void mouseExited(java.awt.event.MouseEvent e) {
print("\nmouse Exited: "+e);
}
They are invoked when I rollout and rollover the application.
How can I solve this problem? I guess It has something to do with the focus that’s why I have been going in that way….
Would be there anyway to say something like:
Code:
public void mouseEntered(java.awt.event.MouseEvent e) {
print("\nmouse Entered: "+e);
requestFocusInWindow();
}
Thanks a lot,
Natalia Rojas