Java warning - JList is a raw type, links must be parameterized

Maybe someone shed more light on the following warning from Eclipse:

JList is a raw type. References to generic type JList<E> should be parameterized.

The code launch line can be:

import javax.swing.JList;
....
private JList jList = null;  // Warning on this line
+5
source share
2 answers

You must put the element type between <>, for example:

List<String> list = new ArrayList<String>();
list.add("String 1");
list.add("Some Text");
+8
source

JList is a raw type with Java 1.7, the same goes for a couple of swing code components. Your x86 and x64_86 environments probably have different versions of java, so you get a warning in one and no warnings in the other.

+2
source

All Articles