Question

I have a project that runs in eclipse on linux, i have moved a copy of it to jbuilder on windows and have run into a few issues.

I get the following error:

The type JList is not generic; it cannot be parameterized with arguments <String>

for this line of code:

private JList<String> songListView;

I have various other issues all of which seem to be related to swing. Is there a particular library i need to import?

Was it helpful?

Solution

JList was not retrofitted with generics until Java SE 7.

You must still be using Java SE 6.

OTHER TIPS

Generics were introduced to the JList class in Java 7. You are most likely using JDK version 6 or under. Upgrade to JDK 7.

Generic Jlist introduced in JDK 7 while in case of older version this feature was not availible.

Point your eclipse to JDK 7 and your issue will be resolved.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top