This week's book giveaway is in the OCAJP forum.
We're giving away four copies of Programmer's Guide to Java SE 8 Oracle Certified Associate (OCA) and have Khalid A Mughal & Rolf W Rasmussen on-line!
See this thread for details.
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

MouseListener and MouseMotionListener interrupting each other.

 
Caleb Kemper
Greenhorn
Posts: 27
Eclipse IDE Java Windows XP
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 27
Eclipse IDE Java Windows XP
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic