Eclipse IDE showing error on Jcombobox which says that JcomboBox can’t be parametarized
eg :something like line showing below
private final JComboBox<LaborHelper> labourname = new JComboBox<LaborHelper>();
here my project execution environment is javaSE1.6
Look at the java 1.6 documentation for JComboxBox, the class
JComboxBoxis not a generic class for Java 1.6.It takes an array or a vector of objects as choices for the users and displays them by calling the toString method of the objects (so you have to override it if you want to customize the labels).
To access the value that the user selected, you will have to cast the selected item as follows:
(LaborHelper)labourname.field.getSelectedItem()However, this should work with java 1.7+ as
JComboxBoxbecame a generic class.