JComponent () { JLabel selectText = new JLabel(message("repository.browser.add.location.prompt")); selectText.setUI(new MultiLineLabelUI()); JPanel mainPanel = new JPanel(new GridBagLayout()); GridBagConstraints gb = new GridBagConstraints(0, 0, 1, 1, 1, 0, NORTHWEST, NONE, insets(5), 0, 0); mainPanel.add(selectText, gb); ++gb.gridy; myCombo = new ComboBox<>(new CollectionComboBoxModel<>(myPreviousLocations)); myCombo.setEditable(true); myCombo.setMinimumSize(size(250, 20)); gb.fill = HORIZONTAL; mainPanel.add(myCombo, gb); gb.fill = NONE; myComboField = (JTextField)myCombo.getEditor().getEditorComponent(); JPanel wrapper = new JPanel(new GridBagLayout()); wrapper.add(mainPanel, new GridBagConstraints(0, 0, 1, 1, 1, 1, NORTHWEST, HORIZONTAL, JBInsets.emptyInsets(), 0, 0)); wrapper.setPreferredSize(size(400, 70)); return wrapper; }