This week's book giveaway is in the Servlets forum.
We're giving away four copies of Murach's Java Servlets and JSP and have Joel Murach on-line!
See this thread for details.
The moose likes Swing / AWT / SWT and the fly likes MouseEntered & MouseExited code seems not to be working...Problem fixed...by myself! :D 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 » Java » Swing / AWT / SWT
Bookmark "MouseEntered & MouseExited code seems not to be working...Problem fixed...by myself! :D" Watch "MouseEntered & MouseExited code seems not to be working...Problem fixed...by myself! :D" New topic
Author

MouseEntered & MouseExited code seems not to be working...Problem fixed...by myself! :D

john price
Ranch Hand

Joined: Feb 24, 2011
Posts: 495

current listeners:

current code snippet:

The System.out.println code is working. The second thing (timer.stop() and timer.start()) doesn't seem to be.
This is a Pong game. This checks if the ball is in the starting position. If "timer" hasn't been started, it will be in this position. Likewise for mouseExited.
Thanks,
cc11rocks

EDIT: Figured it out...Just had to change code to || instead of &&.
Thanks.


“Don’t worry if it doesn’t work right. If everything did, you’d be out of a job.” (Mosher's Law of Software Engineering)
“If debugging is the process of removing bugs, then programming must be the process of putting them in.” (Edsger Dijkstra)
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: MouseEntered & MouseExited code seems not to be working...Problem fixed...by myself! :D
 
Similar Threads
Timer Trouble
Timer Trouble (again)
Timer problem
Timer Trouble (aaaargh)
Suggestions to make code (Pong) better (from the code I have, not adding additional code)