JComponent () { myFieldNamePanel.setLayout(new BorderLayout()); myNameField = new NameSuggestionsField(myProject); myNameChangedListener = () -> updateOkStatus(); myNameField.addDataChangedListener(myNameChangedListener); myNameField.setSuggestions(getSuggestions()); myFieldNamePanel.add(myNameField, BorderLayout.CENTER); List<MavenDomProjectModel> projects = getProjects(); ComboBoxUtil.setModel(myMavenProjectsComboBox, new DefaultComboBoxModel(), projects, model -> Pair.create(MavenDomUtil.getProjectName(model), model)); myMavenProjectsComboBox.setSelectedItem(myMavenDomProjectModel); return myMainPanel; }