|
|
|
|
Re: Upgrading from JAVA 6 to 7 [message #826519 is a reply to message #826246] |
Thu, 22 March 2012 06:55 |
Joop Lanting Messages: 8 Registered: July 2009 |
Junior Member |
|
|
Well, so I did, but half of my projects kept referring the (non-existing) 1.6 library, so I had to change
their properties one by one.
A last question: I managed to solve 31 of the 35 errors ECLIPSE raised when 1.7 became the java version, mostly
by the quick fix.
However 4 (identical) errors remain, quick fix does not do anything here; example:
import java.awt.Color;
import java.awt.Component;
import java.awt.Font;
import javax.swing.DefaultListCellRenderer;
import javax.swing.JLabel;
import javax.swing.JList;
import javax.swing.ListCellRenderer;
public class TestCase
{
static final String[] numbers = { "One", "Two", "Three"};
public static void main(String[] commandLine)
{
JList<String> myList = null;
myList = new JList<String>(numbers);
myList.setCellRenderer(getStripeRenderer(Color.RED, Color.BLUE)); // ERROR below ....
}
static ListCellRenderer getStripeRenderer(Color one, Color two)
{
return(new StripeRenderer(one, two));
}
}
Error message:
Type safety: The expression of type ListCellRenderer needs unchecked conversion to conform to ListCellRenderer<? super String>
I thought I knew a bit about generics but I don't have a clue what to change.
Thanks for your help.
;JOOP!
|
|
|
|
|
Powered by
FUDForum. Page generated in 0.03980 seconds