This Bugzilla instance is a read-only archive of historic NetBeans bug reports. To report a bug in NetBeans please follow the project's instructions for reporting issues.
Create a JPanel. Add a combo box. The following code is generated: private javax.swing.JComboBox jComboBox1; jComboBox1 = new javax.swing.JComboBox(); jComboBox1.setModel(new javax.swing.DefaultComboBoxModel(new String[] { "Item 1", "Item 2", "Item 3", "Item 4" })); When trying to compile you get 3 [rawtypes] warnings, which is understandable. So add String type parameter, and the generated code is like this: private javax.swing.JComboBox<String> jComboBox1; jComboBox1 = new javax.swing.JComboBox<String>(); jComboBox1.setModel(new javax.swing.DefaultComboBoxModel(new String[] { "Item 1", "Item 2", "Item 3", "Item 4" })); That's better, but you still get one warning: T:\Work\Sources\NewJPanel.java:32: warning: [rawtypes] found raw type: DefaultComboBoxModel jComboBox1.setModel(new javax.swing.DefaultComboBoxModel(new String[] { "Item 1", "Item 2", "Item 3", "Item 4" })); missing type arguments for generic class DefaultComboBoxModel<E> where E is a type-variable: E extends Object declared in class DefaultComboBoxModel The code to init the combo box should use the diamond operator: jComboBox1.setModel(new javax.swing.DefaultComboBoxModel<>(new String[] { "Item 1", "Item 2", "Item 3", "Item 4" }));
*** This bug has been marked as a duplicate of bug 227943 ***