void () { myUseScopeFilteringCb.setSelected(false); myScopeCombo.setEnabled(false); myUseScopeFilteringCb.addActionListener(new ActionListener() { @Override public void actionPerformed(ActionEvent e) { myScopeCombo.setEnabled(myUseScopeFilteringCb.isSelected()); } }); }