I always thought that difference between mouseMoved and mouseDragged is that you could get the button pressed in the mouseDragged event. Apparently, you can't, as I just found out. So what is the reason including/using mouseDragged method? Because as for now all my code looks like this:
@Override
public void mouseDragged(MouseEvent e) {
mouseMoved(e);
}
The mouseMoved()
method is called when the user moves the mouse with no buttons pressed. The mouseDragged()
method on the other hand is called when the user moves the mouse while holding down a mouse button.
Check out this page for more information.