|
-
February 29th, 2000, 01:16 PM
#1
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
-
February 29th, 2000, 04:03 PM
#2
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);
-
February 29th, 2000, 05:49 PM
#3
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=
-
March 1st, 2000, 02:49 PM
#4
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
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|