下面列出了javax.swing.AbstractButton#removeActionListener ( ) 实例代码,或者点击链接到github查看源代码,也可以在右侧发表评论。
/**
* Remove all action listeners from a button.
*
* @param button Button.
*/
public static void removeActionListeners(AbstractButton button) {
if (button == null) {
return;
}
ActionListener[] listeners = button.getActionListeners();
if (listeners == null) {
return;
}
for (ActionListener listener : listeners) {
button.removeActionListener(listener);
}
}
/** Detaches given button from this recognizer, it means stops listening
* on its various mouse and action events
*/
public void detachButton (AbstractButton button) {
button.removeActionListener(this);
button.removeMouseListener(this);
button.addMouseMotionListener(this);
}