File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
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


Win a copy of Soft Skills this week in the Jobs Discussion forum!
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 agree. Here's the link: http://aspose.com/file-tools
 
subject: MouseEvent.getX()/getY() Returning Negative Value