• Post Reply Bookmark Topic Watch Topic
  • New Topic

Getting current mouse position  RSS feed

 
Ian Calegory
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Is there a way to get the current mouse position without having to do it in a mouse event listener? I'm in a component listener (the component_moved event) and need to use java.awt.Robot to update the current mouse position, but I need to know the current mouse position to do this.
I could find out the mouse position during a mouse_released event, but no such event is generated when moving a JFrame by its title bar and releasing the mouse.
Thanks for any help.
Ian
 
Daniel Bauer
Ranch Hand
Posts: 49
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Use the java.awt.MouseInfo class.

More information at: java.sun.com/j2se/1.5.0/docs/api/java/awt/MouseInfo.html
[ April 15, 2006: Message edited by: Daniel Bauer ]
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!