When I try to compile some code I keep getting these errors:
CCC.java:21: type javax.swing.JList does not take parameters
JList<String> list;
or:
CCC.java:30: type javax.swing.DefaultListModel does not take parameters
DefaultListModel<String> jobs, DefaultListModel<String> closJ) throws HeadlessException {
I have about 26 of the same error when I try to remove the section i get about 150 lines of errors can anyone help please.
Generics were added to JList in Java 7. Here's an example from the JList documentation:
String[] data = {"one", "two", "three", "four"};
JList<String> myList = new JList<String>(data);
Make sure you're using Java 7+.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With