void () { mySelectAggregator.addActionListener(new ActionListener() { @Override public void actionPerformed(ActionEvent e) { myAggregator = doSelectProject(myAggregator); updateComponents(); } }); mySelectParent.addActionListener(new ActionListener() { @Override public void actionPerformed(ActionEvent e) { myParent = doSelectProject(myParent); updateComponents(); } }); ActionListener updatingListener = new ActionListener() { @Override public void actionPerformed(ActionEvent e) { updateComponents(); } }; myInheritGroupIdCheckBox.addActionListener(updatingListener); myInheritVersionCheckBox.addActionListener(updatingListener); }