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
Printable View
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
If you just want to select or highlight some rows, you can use:
table.setRowSelectionInterval(indexa, indexb);
You have to play with Cell Renderers ..
Check this post : http://codeguru.developer.com/bbs/wt...age=&view=&sb=
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