I have made this:
private JComboBox vehicleType = new JComboBox();
DefaultComboBoxModel<Class> dcbm = new DefaultComboBoxModel<Class>(
new Class[] {Truck.class, Trailer.class, RoadTractor.class, SemiTrailer.class, Van.class, Car.class})
{
@Override
public String getSelectedItem() {
return ((Class<?>)super.getSelectedItem()).getSimpleName();
}
};
And I have obtained this:
How you can see, the selected item show his simple class name, but in the list... doesn't. How I can make this?