This week's book giveaway is in the OCAJP forum.
We're giving away four copies of OCA Java SE 8 Programmer I Study Guide 1Z0-808 and have Jeanne Boyarsky & Scott Selikoff on-line!
See this thread for details.
The moose likes Game Development and the fly likes MouseListener and MouseMotionListener interrupting each other. Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of OCA Java SE 8 Programmer I Study Guide 1Z0-808 this week in the OCAJP forum!
JavaRanch » Java Forums » Java » Game Development
Bookmark "MouseListener and MouseMotionListener interrupting each other." Watch "MouseListener and MouseMotionListener interrupting each other." New topic
Author

MouseListener and MouseMotionListener interrupting each other.

Caleb Kemper
Greenhorn

Joined: Feb 08, 2012
Posts: 27

In a simple game I'm coding, I need the MouseMotionListener to continue to call MouseMoved and accordingly adjust the rotation of the AffineTransform for my BufferedImage, even when the MouseListener is calling MouseClicked or MouseReleased. While it's calling these (say, I'm holding the mouse key down) it stops listening for motion. Is there a way around this? I tried adding another MouseMotionListener in the MouseClicked method. Still doesn't work. Also tried having it update the image when calling MouseDragged as well. Still nothing.
Any insight would be greatly appreciated.
Caleb Kemper
Greenhorn

Joined: Feb 08, 2012
Posts: 27

Don't know if anyone was keeping an eye on this for an answer, but I figured it out.
Basically, the Listeners were not interrupting each other (at least not significantly, to where the human eye could notice). It was just an issue with my MouseListener. I was using mouseClicked instead of mouseReleased for what I needed.
LiveLong&&Prosper
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: MouseListener and MouseMotionListener interrupting each other.