JCheckBox (JCheckBox boundComponent) { JCheckBox checkBox = boundComponent == null ? new JCheckBox() : boundComponent; checkBox.addActionListener(new ActionListener() { @Override public void actionPerformed(ActionEvent e) { myUndefined = false; setModified(); commit(); reset(); } }); return checkBox; }