I want to add different Enums to a single JComboBox. Here is how the code looks like. Type contains 3 different type of Enums(Colors, Shapes, Dimensions).
final JComboBox typeJComboBox = new JComboBox(Type.Colors.values());
for(Type.Shapes shape: Type.Shapes.values()) {
typeJComboBox .addItem(shape);
}
for(Type.Dimensions dimension : Type.Dimensions.values()) {
typeJComboBox .addItem(dimension );
}
What generic type do I use? When using eclipse, there is a yellow squiggly line under JComboBox and when you hover your mouse over it, it says "Infer Generic Type Arguments...".