|
JavaTM 2 Platform Standard Ed. 6 |
|||||||||
| 上一個類別 下一個類別 | 框架 無框架 | |||||||||
| 摘要: 巢狀 | 欄位 | 建構子 | 方法 | 詳細資訊: 欄位 | 建構子 | 方法 | |||||||||
java.lang.Objectjava.awt.event.MouseMotionAdapter
public abstract class MouseMotionAdapter
接收鼠標移動事件的抽象適配器類別。此類別中的方法為空。此類別存在的目的是方便創建偵聽器物件。
移動或拖動鼠標時會發生鼠標移動事件。(在正常程序中會產生很多此類別事件。要追蹤單擊和其他鼠標事件,請使用 MouseAdapter。)
擴展此類別可創建 MouseEvent 偵聽器並覆寫所需事件的方法。(如果要實作 MouseMotionListener 介面,則必須定義該介面內的所有方法。此抽象類別將所有方法都定義為 null,所以只需針對關心的事件定義方法。)
使用擴展的類別可以創建偵聽器物件,然後使用元件的 addMouseMotionListener 方法向該元件註冊此偵聽器物件。移動或拖動鼠標時,將調用該偵聽器物件中的相應方法,並將 MouseEvent 傳遞給該方法。
MouseEvent,
MouseMotionListener,
Tutorial: Writing a Mouse Motion Listener| 建構子摘要 | |
|---|---|
MouseMotionAdapter()
|
|
| 方法摘要 | |
|---|---|
void |
mouseDragged(MouseEvent e)
鼠標按鍵在元件上按下並拖動時調用。 |
void |
mouseMoved(MouseEvent e)
鼠標按鍵在元件上移動(無按鍵按下)時調用。 |
| 從類別 java.lang.Object 繼承的方法 |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| 建構子詳細資訊 |
|---|
public MouseMotionAdapter()
| 方法詳細資訊 |
|---|
public void mouseDragged(MouseEvent e)
MouseMotionListener 中的 mouseDraggedpublic void mouseMoved(MouseEvent e)
MouseMotionListener 中的 mouseMoved
|
JavaTM 2 Platform Standard Ed. 6 |
|||||||||
| 上一個類別 下一個類別 | 框架 無框架 | |||||||||
| 摘要: 巢狀 | 欄位 | 建構子 | 方法 | 詳細資訊: 欄位 | 建構子 | 方法 | |||||||||
版權所有 2008 Sun Microsystems, Inc. 保留所有權利。請遵守GNU General Public License, version 2 only。