好的我正在使用eclipse及其GUI编辑器,我有一个这样的字符串:
public static String[] blah = {"Blah", "Blah", "Blah", "Blah"};
Run Code Online (Sandbox Code Playgroud)
和这样的JComboBox:
JComboBox comboBox = new JComboBox(blah);
comboBox.setBounds(10, 56, 312, 37);
contentPane.add(comboBox);
Run Code Online (Sandbox Code Playgroud)
组合框使用上面的字符串来获取其数据,但当我输入"blah"到组合框时,它有这个错误...
Type safety: The constructor JComboBox(Object[]) belongs to the raw type JComboBox. References to generic type JComboBox<E> should be parameterized
Run Code Online (Sandbox Code Playgroud)
如果我运行它是有效的,因为它只是一个警告,但它很烦人,因为它不会让我进入设计模式,除非我作出评论.设计模式给出了这个错误......
INVALID SOURCE. No Constructor Binding. --- new JComboBox(locations) is not valid source for component creation, it references not existing constructor.
Run Code Online (Sandbox Code Playgroud)
所以我想知道是否还有其他办法可以解决这个问题