void (ActionEvent e) { if (!myNotifyCaughtCheckBox.isSelected() && !myNotifyUncaughtCheckBox.isSelected()) { Object source = e.getSource(); JCheckBox toCheck = null; if (myNotifyCaughtCheckBox.equals(source)) { toCheck = myNotifyUncaughtCheckBox; } else if (myNotifyUncaughtCheckBox.equals(source)) { toCheck = myNotifyCaughtCheckBox; } if (toCheck != null) { toCheck.setSelected(true); } } }