Results 1 to 3 of 3
  1. #1
    sciuriware's Avatar
    sciuriware is offline Member
    Join Date
    Mar 2012
    Location
    The Netherlands
    Posts
    9
    Rep Power
    0

    Default 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!

  2. #2
    DarrylBurke's Avatar
    DarrylBurke is offline Forum Police
    Join Date
    Sep 2008
    Location
    Madgaon, Goa, India
    Posts
    11,458
    Rep Power
    20

    Default 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 09:14 PM.
    If you're forever cleaning cobwebs, it's time to get rid of the spiders.

  3. #3
    sciuriware's Avatar
    sciuriware is offline Member
    Join Date
    Mar 2012
    Location
    The Netherlands
    Posts
    9
    Rep Power
    0

    Default Re: What's wrong with this renderer for striping

    Thanks for your help.

Similar Threads

  1. Web PDF Renderer
    By java software in forum Java Software
    Replies: 0
    Last Post: 10-20-2011, 07:41 PM
  2. ProgressBar Renderer?
    By greatmajestics in forum AWT / Swing
    Replies: 2
    Last Post: 04-20-2010, 05:12 AM
  3. ProgressBar renderer Help?
    By greatmajestics in forum AWT / Swing
    Replies: 0
    Last Post: 04-17-2010, 10:39 PM
  4. jtable cell renderer
    By ankitmcgill in forum New To Java
    Replies: 2
    Last Post: 05-22-2009, 02:08 AM
  5. how to use renderer in JTable
    By sunilpatel28 in forum Advanced Java
    Replies: 0
    Last Post: 12-09-2008, 09:01 AM

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •