CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 4 of 4
  1. #1
    Guest

    Chage the color of a row in JTABLE

    Hi,
    Can anybody suggest me how can I change the row colors for the JTABLE rows ?
    I have using AbstractTableModel to create my table.

    Thanks in advance,

    Niranjan



  2. #2
    Join Date
    Aug 1999
    Location
    San Diego
    Posts
    155

    Re: Chage the color of a row in JTABLE

    If you just want to select or highlight some rows, you can use:

    table.setRowSelectionInterval(indexa, indexb);


  3. #3
    Join Date
    Sep 1999
    Location
    Madurai , TamilNadu , INDIA
    Posts
    1,024

    Re: Chage the color of a row in JTABLE


    You have to play with Cell Renderers ..

    Check this post : http://codeguru.developer.com/bbs/wt...age=&view=&sb=


  4. #4
    Guest

    Re: Chage the color of a row in JTABLE

    Hey,
    Your code works great ! Thanks...But I was trying to display a report with alternate rows having different color.
    So if I associate the data element with color, it doesn't work properly..like if I have a city column in the report it will have the
    same color for the city in all the places...irrespective of the rows.
    I am using Vector to store the data and each element of the vector is a data-row ? Can you suggest something about this ?

    Thanks in advance
    Niranjan


Posting Permissions

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





Click Here to Expand Forum to Full Width

Featured