• Post Reply Bookmark Topic Watch Topic
  • New Topic

Is there a way to listen to mouse events without a window (or outside a window)?  RSS feed

 
Dan Bizman
Ranch Hand
Posts: 387
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
If I start a java application, but don't have a window/frame/panel, etc, can i still listen to mouse move events? What about if I do have a window but the mouse move events are occurring outside the window?
 
Campbell Ritchie
Sheriff
Posts: 55351
157
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You will have to try it, but I think you can only "listen" to mouse events inside the bound of a GUI. Try a MouseListener and see what happens when you click outside your GUI; I suspect nothing will happen.
 
Dan Bizman
Ranch Hand
Posts: 387
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by Campbell Ritchie:
You will have to try it, but I think you can only "listen" to mouse events inside the bound of a GUI. Try a MouseListener and see what happens when you click outside your GUI; I suspect nothing will happen.


It does not work but you can use Robot to make the mouse move outside any frames. I don't know why Robot wasn't given the ability to listen to mouse movement outside a window. I'm pretty sure it can be done and I think it can be done in .Net.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!