Win a copy of Programmer's Guide to Java SE 8 Oracle Certified Associate (OCA) this week in the OCAJP forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

MouseEvent

 
Savio Mascarenhas
Ranch Hand
Posts: 108
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 13071
6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 108
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Got it Thanks !!!
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic