I am using a project that can be compiled on both Java 6 and Java 7 platforms. One of the GUI classes uses JComboBox. Because JComboBox changed its specification in Java 7 to a generic type, it requires a parametric declaration of the component.
In a Java 6 declaration, for example:
JComboBox mybox;
OK and gives no errors, no warnings.
In Java 7, the same component declaration gives a warning
JComboBox is a raw type. References to generic type JComboBox<E> should be parameterized
Providing parameters on request of Java 7:
JComboBox<String> mybox;
resolves warnings for the Java 7 platform, but I get a compilation error in Java 6.
What can I do in this case, so both Java 6 and 7 platforms can live in peace for my project?
kpoxa source share