how are the appropriate methods of MouseMotionListener in Java Swing?
问题 consider this class : public class mycomponent extends JComponent { public mycomponent(){ addMouseMotionListener(new MouseMotionHandler()); } class MouseMotionHandler implements MouseMotionListener{ public void mouseMoved(MouseEvent event){ //do something } public void mouseDragged(MouseEvent event){ //do something } } } Now Lets say a mouse drag event occurs. How does the MouseMotionHandler knows which method to call. of the two methods implemented. Or how is the method to be called resolved