I would like to populate a java.swing JComboBox with values from an Enum.
e.g.
public enum Mood { HAPPY, SAD, AWESOME; }
and have these three values populate a readonly JComboBox.
Thanks!
I would like to populate a java.swing JComboBox with values from an Enum.
e.g.
public enum Mood { HAPPY, SAD, AWESOME; }
and have these three values populate a readonly JComboBox.
Thanks!
This can also be achieved using only the default constructor and without using setModel() method:
JComboBox<Mood> comboBox_mood = new JComboBox<>();