• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Curser invisibility and positioning.

 
Ranch Hand
Posts: 39
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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.
 
Rancher
Posts: 3324
32
  • Likes 1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Much obliged, Rob.
 
Consider Paul's rocket mass heater.
reply
    Bookmark Topic Watch Topic
  • New Topic