JComponent () { final ComboBox<ArtifactType> artifactTypeBox = new ComboBox<>(); for (ArtifactType type : ArtifactType.getAllTypes()) { artifactTypeBox.addItem(type); } artifactTypeBox.setRenderer(SimpleListCellRenderer.create((label, value, index) -> { label.setIcon(value.getIcon()); label.setText(value.getPresentableName()); })); artifactTypeBox.setSelectedItem(getArtifact().getArtifactType()); artifactTypeBox.addActionListener(new ActionListener() { @Override public void actionPerformed(ActionEvent e) { final ArtifactType selected = (ArtifactType)artifactTypeBox.getSelectedItem(); if (selected != null && !Comparing.equal(selected, getArtifact().getArtifactType())) { getEditor().setArtifactType(selected); } } }); final JPanel panel = new JPanel(new FlowLayout()); JLabel artifactTypeBoxLabel = new JLabel(JavaUiBundle.message("label.artifact.configurable.type")); artifactTypeBoxLabel.setLabelFor(artifactTypeBox); panel.add(artifactTypeBoxLabel); panel.add(artifactTypeBox); return panel; }