File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Programmer Certification (SCJP/OCPJP) and the fly likes MouseEvent Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Spring in Action this week in the Spring forum!
JavaRanch » Java Forums » Certification » Programmer Certification (SCJP/OCPJP)
Bookmark "MouseEvent" Watch "MouseEvent" New topic
Author

MouseEvent

Savio Mascarenhas
Ranch Hand

Joined: Nov 29, 2000
Posts: 108
In a mock exam it was marked true that "MouseEvents of the MOUSE_DRAGGED type may report negative values for the x and y position." Are'nt the co-ordinates +ve ?
William Brogden
Author and all-around good cowpoke
Rancher

Joined: Mar 22, 2000
Posts: 12803
    
    5
Try it yourself.
What happens is that a mouse drag that starts in a component continues to send events to that component even after the drag has left the normal component area. The coordinates are positive relative to the upper left corner of the component so they will go negative if the drag goes past that point.
Bill
Savio Mascarenhas
Ranch Hand

Joined: Nov 29, 2000
Posts: 108
Got it Thanks !!!
 
It is sorta covered in the JavaRanch Style Guide.
 
subject: MouseEvent