public class BasicButtonListener extends Object implements MouseListener, MouseMotionListener, FocusListener, ChangeListener, PropertyChangeListener
Constructor and Description |
---|
BasicButtonListener(AbstractButton b) |
Modifier and Type | Method and Description |
---|---|
protected void |
checkOpacity(AbstractButton b) |
void |
focusGained(FocusEvent e)
当组件获得键盘焦点时调用。
|
void |
focusLost(FocusEvent e)
当组件丢失键盘焦点时调用。
|
void |
installKeyboardActions(JComponent c)
注册默认按键操作:按空格键“点击”按钮并注册键盘助记符(如果有的话)。
|
void |
mouseClicked(MouseEvent e)
在组件上单击(按下并释放)鼠标按钮时调用。
|
void |
mouseDragged(MouseEvent e)
在组件上按下鼠标按钮然后拖动时调用。
|
void |
mouseEntered(MouseEvent e)
当鼠标进入组件时调用。
|
void |
mouseExited(MouseEvent e)
当鼠标退出组件时调用。
|
void |
mouseMoved(MouseEvent e)
当鼠标光标移动到组件上但没有按钮被按下时调用。
|
void |
mousePressed(MouseEvent e)
在组件上按下鼠标按钮时调用。
|
void |
mouseReleased(MouseEvent e)
在组件上释放鼠标按钮时调用。
|
void |
propertyChange(PropertyChangeEvent e)
当绑定属性更改时,此方法将被调用。
|
void |
stateChanged(ChangeEvent e)
当侦听器的目标已更改其状态时调用。
|
void |
uninstallKeyboardActions(JComponent c)
取消注册的默认键操作
|
public BasicButtonListener(AbstractButton b)
public void propertyChange(PropertyChangeEvent e)
PropertyChangeListener
复制
propertyChange
在界面
PropertyChangeListener
e
- 描述事件源和已更改的属性的PropertyChangeEvent对象。
protected void checkOpacity(AbstractButton b)
public void installKeyboardActions(JComponent c)
public void uninstallKeyboardActions(JComponent c)
public void stateChanged(ChangeEvent e)
ChangeListener
复制
stateChanged
在界面
ChangeListener
e
- 一个ChangeEvent对象
public void focusGained(FocusEvent e)
FocusListener
focusGained
在界面
FocusListener
public void focusLost(FocusEvent e)
FocusListener
focusLost
在接口
FocusListener
public void mouseMoved(MouseEvent e)
MouseMotionListener
mouseMoved
在界面
MouseMotionListener
public void mouseDragged(MouseEvent e)
MouseMotionListener
MOUSE_DRAGGED
事件将继续传递到拖动发起的组件,直到鼠标按钮释放(无论鼠标位置是否在组件的边界内)。
由于平台相关的拖放实现, MOUSE_DRAGGED
事件可能不会在本机拖放操作期间传递。
mouseDragged
在接口
MouseMotionListener
public void mouseClicked(MouseEvent e)
MouseListener
mouseClicked
在界面
MouseListener
public void mousePressed(MouseEvent e)
MouseListener
mousePressed
在界面
MouseListener
public void mouseReleased(MouseEvent e)
MouseListener
mouseReleased
在界面
MouseListener
public void mouseEntered(MouseEvent e)
MouseListener
mouseEntered
在界面
MouseListener
public void mouseExited(MouseEvent e)
MouseListener
mouseExited
在接口
MouseListener
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.