OK I use eclipse and its graphical editor, and I have a line like this:
public static String[] blah = {"Blah", "Blah", "Blah", "Blah"};
and JComboBox:
JComboBox comboBox = new JComboBox(blah);
comboBox.setBounds(10, 56, 312, 37);
contentPane.add(comboBox);
The combobox uses the line above to get its data, but when I enter the "blah" in the combo box, it has this error ...
Type safety: The constructor JComboBox(Object[]) belongs to the raw type JComboBox. References to generic type JComboBox<E> should be parameterized
it works if I run it because it is only a warning, but it is annoying because it will not allow me to enter design mode unless I make it a comment. design mode gives this error ...
INVALID SOURCE. No Constructor Binding. --- new JComboBox(locations) is not valid source for component creation, it references not existing constructor.
so I would like to know if there is another way to overcome this problem.
source
share