Two Laptop Bag*
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 Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Certification » Programmer Certification (SCJP/OCPJP)
Bookmark "MouseEvent" Watch "MouseEvent" New topic


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

Joined: Mar 22, 2000
Posts: 12760
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.
Savio Mascarenhas
Ranch Hand

Joined: Nov 29, 2000
Posts: 108
Got it Thanks !!!
I agree. Here's the link:
subject: MouseEvent
Similar Threads
no mouseClicked when TransferHandler set for JLabel?
Is there anyway of overriding the default signal for PopupMenus
want to forward MouseEvents from child to parent component
How to detect right click?