public interface MouseMotionListener extends EventListener
MouseListener
班级,在处理鼠标移动事件感兴趣实现这个接口(和所有的方法,它包含)或扩展摘要MouseMotionAdapter
类(只覆盖方法的兴趣)。
从这个类进行了注册一个组件使用的组件的addMouseMotionListener
方法创建监听对象。鼠标移动或拖动时产生鼠标运动事件。(许多这样的事件将被产生)。当鼠标移动事件的发生,在监听对象相关的方法被调用时,与MouseEvent
传递给它。
MouseMotionAdapter
,
MouseEvent
,
Tutorial: Writing a Mouse Motion Listener
Modifier and Type | Method and Description |
---|---|
void |
mouseDragged(MouseEvent e)
当鼠标按钮被按下一个组件,然后拖动时调用。
|
void |
mouseMoved(MouseEvent e)
当鼠标指针移动到一个组件上时调用,但没有被推。
|
void mouseDragged(MouseEvent e)
MOUSE_DRAGGED
事件不断被传递到组件拖动起源直到鼠标按钮被释放(不管鼠标的位置是在组件的边界)。
由于平台依赖的拖放实现,MOUSE_DRAGGED
事件可能不交在本地拖放操作。
void mouseMoved(MouseEvent e)
Submit a bug or feature
For further API reference and developer documentation, see Java SE Documentation. That documentation contains more detailed, developer-targeted descriptions, with conceptual overviews, definitions of terms, workarounds, and working code examples.
Copyright © 1993, 2014, Oracle and/or its affiliates. All rights reserved.