} if (comboBox.isEditable()) { arrowButton.setText(null); if (editor != null) editor.setVisible(true); } else { String text = ""; Object selected = comboBox.getSelectedItem(); if (selected != null) text = selected.toString(); arrowButton.setText(text); if (editor != null) editor.setVisible(true);
b.setFocusable(!comboBox.isEditable() && comboBox.isEnabled()); comboBox.repaint();
  protected void editablePropertyChanged(PropertyChangeEvent e)  {    if (arrowButton instanceof MetalComboBoxButton)      {        MetalComboBoxButton b = (MetalComboBoxButton) arrowButton;        b.setIconOnly(comboBox.isEditable());      }    if (comboBox.isEditable())      {        arrowButton.setText(null);        if (editor != null)          editor.setVisible(true);      }    else      {        String text = "";        Object selected = comboBox.getSelectedItem();        if (selected != null)          text = selected.toString();        arrowButton.setText(text);        if (editor != null)          editor.setVisible(true);      }  }