2

How can I hide the mouse cursor on whole screen in Java? I used the transparent gif techinique, but it only works on the JFrame area. I need it to work outside the JFrame bounds.

  • more suggestions here: http://stackoverflow.com/questions/191592/how-do-i-get-rid-of-the-mouse-cursor-in-full-screen-exclusive-mode – ericsoco Aug 30 '11 at 20:23

2 Answers2

1

One way is to use transperent GIF and another is mentioned here

Community
  • 1
  • 1
jmj
  • 237,923
  • 42
  • 401
  • 438
0

I think an application that can hide the cursor for itself and any other application running on the same desktop is, well, not desirable for usability and maybe security implications. Therefore I guess the win32 API has numerous ways to do it. Even by accident. But (un?)fortunately Java has no API to accomplish this.

Possibly the Robot is of help for you. You could create a full-sceen capture which gets displayed in turn by an full-screen JFrame which in turn has no visible pointer.

Waldheinz
  • 10,399
  • 3
  • 31
  • 61
  • 1
    no offense, but i would vote this down if i had a bit more reputation...there are plenty of use cases (e.g. art and museum installations) in which interaction with the content is achieved through non-mouse+keyboard interfaces, and a mouse cursor can be distracting or misleading. – ericsoco Aug 30 '11 at 20:22
  • 3
    But such an installation would likely be implemented as an full-screen application, which can hide it's mouse cursor as it likes. My main point was that it seems a bad idea if one application was able to hide the mouse cursor globally (or for any other application). – Waldheinz Sep 01 '11 at 12:09