JComponent () { ComboBoxUtil.setModel(myMavenProjectsComboBox, new DefaultComboBoxModel(), myMavenDomProjectModels, model -> Pair.create(MavenDomUtil.getProjectName(model), model)); myReplaceAllListener = new ItemListener() { @Override public void itemStateChanged(ItemEvent e) { updateControls(); } }; myMavenProjectsComboBox.addItemListener(myReplaceAllListener); myMavenProjectsComboBox.setSelectedItem(0); myReplaceAllCheckBox.setVisible(myHasUsagesInProjects); myExtractExclusions.setVisible(myHasExclusions); updateControls(); return myMainPanel; }