• Post Reply Bookmark Topic Watch Topic
  • New Topic

Curser invisibility and positioning.  RSS feed

 
Edward Nunez
Ranch Hand
Posts: 39
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hey guys, is there a simple way to hide the mouse cursor?

Also, the e.getX()/Y() methods in my mouse listeners always spit out the position of the mouse relative to window instead of the entire screen. Is there a way to flip that or at least a way to track the movement of my window on my screen? Another acceptable fix for me would be to have my Robot object's mouseMouse(x,y) method move my mouse to a position (x,y) relative to the window instead of the entire screen.
 
Rob Camick
Ranch Hand
Posts: 2801
15
  • Likes 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
the e.getX()/Y() methods in my mouse listeners always spit out the position of the mouse relative to window instead of the entire screen.


You can:

1. add the location of the Window to the X/Y values
2. use the getLocationOnScreen() method of the Component class
3. use the MouseInfo class

is there a simple way to hide the mouse cursor?


 
Edward Nunez
Ranch Hand
Posts: 39
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Much obliged, Rob.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!