2

I have a JComboBox<SelectionOption> where the user can choose from a few options. By default, none is selected comboBox.getModel.setSelectedItem(null), but I'd like to display a text that says something like "Please choose from the 5 Options" when the selection is null.

Can I achieve this somehow without adding a fake SelectionOption?

PriorityMark
  • 3,247
  • 16
  • 22
dmeu
  • 3,842
  • 5
  • 27
  • 43
  • 2
    http://stackoverflow.com/questions/16665688/display-a-non-selectable-default-value-for-jcombobox You're looking for a "placeholder". Yes it is entirely doable, just look around at examples. – Daniel B. Chapman Feb 27 '14 at 22:49
  • Your link looks like something I could use. Thanks very much! – dmeu Feb 27 '14 at 23:07

0 Answers0