void () { final ActionListener testTypeListener = new ActionListener() { @Override public void actionPerformed(final ActionEvent e) { setTestType(getTestType()); } }; addTestTypeListener(testTypeListener); myPatternCheckBox.addActionListener(new ActionListener() { @Override public void actionPerformed(final ActionEvent e) { myPatternTextField.setEnabled(myPatternCheckBox.isSelected()); } }); myParamCheckBox.addActionListener(new ActionListener() { @Override public void actionPerformed(final ActionEvent e) { myParamTextField.setEnabled(myParamCheckBox.isSelected()); } }); }