Granny's Programming Pearls
"inside of every large program is a small program struggling to get out"
JavaRanch.com/granny.jsp
The moose likes Swing / AWT / SWT and the fly likes MouseEvent.getX()/getY() Returning Negative Value Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Swing / AWT / SWT
Bookmark "MouseEvent.getX()/getY() Returning Negative Value" Watch "MouseEvent.getX()/getY() Returning Negative Value" New topic
Author

MouseEvent.getX()/getY() Returning Negative Value

Alec Lee
Ranch Hand

Joined: Jan 28, 2004
Posts: 569
I found that the MouseEvent.getX()/getY() could sometimes return negative value (-1 but very close to 0) for a mouse_moved event when I move the mouse to the top left hand corner. But isn't 0 the leftest that the mouse could move on a Component? Further mouse move should simply means the event generated to the background container, never to this component.
Alec Lee
Ranch Hand

Joined: Jan 28, 2004
Posts: 569
My mistake. Looks like it is not mouse_moved event. Rather it is mouse_exited.
 
I’ve looked at a lot of different solutions, and in my humble opinion Aspose is the way to go. Here’s the link: http://aspose.com
 
subject: MouseEvent.getX()/getY() Returning Negative Value
 
It's not a secret anymore!