wood burning stoves 2.0*
The moose likes Swing / AWT / SWT and the fly likes MouseDragged doesn't seem to be working Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Java » Swing / AWT / SWT
Bookmark "MouseDragged doesn Watch "MouseDragged doesn New topic
Author

MouseDragged doesn't seem to be working

john price
Ranch Hand

Joined: Feb 24, 2011
Posts: 495

I'm trying to learn about mouseDragged. Here is my code:

Output:

I obviously am supposed to get some system.out.println's, and there is no system output. What is wrong?
Thanks,
cc11rocks


“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)
Darryl Burke
Bartender

Joined: May 03, 2008
Posts: 4523
    
    5

The only listeners you added are MouseListener and KeyListener. mouseDragged isn't a part of either.


luck, db
There are no new questions, but there may be new answers.
john price
Ranch Hand

Joined: Feb 24, 2011
Posts: 495

Darryl Burke wrote:The only listeners you added are MouseListener and KeyListener. mouseDragged isn't a part of either.

Thank you very much!
Solution add:

Thanks,
cc11rocks
Stephan van Hulst
Bartender

Joined: Sep 20, 2010
Posts: 3600
    
  14

It's more difficult to make mistakes like that if you make anonymous listeners, like I advised you before.

In any case, you should never have a JPanel also implement listener classes. It's very poor form.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: MouseDragged doesn't seem to be working
 
Similar Threads
Graphics?????
MouseListener isn't working right
Messagebox with Mouseevent
Movement is wacky, just increases.
Timer problem