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

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

源代码1 项目: tn5250j   文件: Wizard.java
public void componentRemoved(ContainerEvent e) {
   if (e.getChild() instanceof WizardPage) {
      WizardPage wp = (WizardPage)e.getChild();
      JButton b;
      b = wp.getNextButton();
      if (b != null) {
         b.removeActionListener(nextListener);
      }
      b = wp.getPreviousButton();
      if (b != null) {
         b.removeActionListener(previousListener);
      }
      b = wp.getFinishButton();
      if (b != null) {
         b.removeActionListener(finishListener);
      }
      b = wp.getCancelButton();
      if (b != null) {
         b.removeActionListener(cancelListener);
      }
      b = wp.getHelpButton();
      if (b != null) {
         b.removeActionListener(helpListener);
      }
   }
}
 
源代码2 项目: megamek   文件: SkinSpecPanel.java
/**
 * Remove thsi SkinSpecEditor as a listener from all components.
 */
private void removeListeners() {
    for (JButton colorButton : colorButtons) {
        colorButton.removeActionListener(this);
    }
    addColor.removeActionListener(this);
    removeColor.removeActionListener(this);
}