下面列出了javax.swing.JButton#removeActionListener ( ) 实例代码,或者点击链接到github查看源代码,也可以在右侧发表评论。
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);
}
}
}
/**
* 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);
}