Results 1 to 3 of 3
- 03-21-2012, 08:01 PM #1
What's wrong with this renderer for striping
Partial code:
public class TestCase
{
/**
* Data
*/
static final String[] numbers = { "One", "Two", "Three"};
/**
* Program entry point.
*
* @param commandLine program command line vector.
*/
public static void main(String[] commandLine)
{
JList<String> myList = null;
myList = new JList<String>(numbers);
myList.setCellRenderer
(
getStripeRenderer (*) error message below
(
Color.RED,
Color.BLUE
)
);
}
/**
* Obtains a stripe renderer for long line oriented item choosers.
*
* @param one 1st colour to apply.
* @param two 2nd colour to apply.
* @return a 2-colour renderer.
*/
ListCellRenderer getStripeRenderer(Color one, Color two)
{
return(new StripeRenderer(one, two));
}
}
Error message at (*):
Type safety: The expression of type ListCellRenderer needs unchecked conversion to conform to ListCellRenderer<? super String>
I don't get it; thanks for reading it.
;JOOP!
- 03-21-2012, 08:11 PM #2
Re: What's wrong with this renderer for striping
Error or warning?
And go through the FAQs section of the site and learn how to use the code tags so that your code retains its formatting.
Was it really necessary to post inane (and probably autogenerated) javadoc comments here? That just adds clutter.
db
edit: Have you learned Generics?Last edited by DarrylBurke; 03-21-2012 at 08:14 PM.
Why do they call it rush hour when nothing moves? - Robin Williams
- 03-21-2012, 08:21 PM #3
Similar Threads
-
Web PDF Renderer
By java software in forum Java SoftwareReplies: 0Last Post: 10-20-2011, 06:41 PM -
ProgressBar Renderer?
By greatmajestics in forum AWT / SwingReplies: 2Last Post: 04-20-2010, 04:12 AM -
ProgressBar renderer Help?
By greatmajestics in forum AWT / SwingReplies: 0Last Post: 04-17-2010, 09:39 PM -
jtable cell renderer
By ankitmcgill in forum New To JavaReplies: 2Last Post: 05-22-2009, 01:08 AM -
how to use renderer in JTable
By sunilpatel28 in forum Advanced JavaReplies: 0Last Post: 12-09-2008, 08:01 AM


LinkBack URL
About LinkBacks
Reply With Quote

Bookmarks