Interesting ... digging a bit turns out that the interaction of selected/armed/pressed is somewhat confused by the interrupted check (faintly remember some bug, but can't find it right now). The main issue is to not allow the re-entry into the setSelected method. A dirty (read: didn't to dig further) way out is to have toggle a flag, something like
private boolean isChecking;
@Override
public void setSelected(final ButtonModel m, boolean b) {
if (isChecking) return;
isChecking = false;
if (!b) {
return;
}
if (m == buttonB.getModel()) {
isChecking = true;
final boolean select = check();
if (select) {
superSetSelected(m, select);
}
isChecking = false;
return;
} else {
superSetSelected(m, b);
}
}
protected void superSetSelected(ButtonModel m, boolean b) {
super.setSelected(m, b);
}