javax.swing.AbstractButton#removeActionListener ( )源码实例Demo

下面列出了javax.swing.AbstractButton#removeActionListener ( ) 实例代码,或者点击链接到github查看源代码,也可以在右侧发表评论。

源代码1 项目: wpcleaner   文件: ActionUtilities.java
/**
 * 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);
  }
}
 
源代码2 项目: netbeans   文件: SlideGestureRecognizer.java
/** 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);
}