posted 13 years ago
Hi Guys,
Is it possible to change the colour of the JTable Cell Dynamically ?
i have set different colour for certain rows by overriding the prepareRenderer (TableCellRenderer renderer, int index_row, int index_col) in the JTable as below:
and now i have to set different colours for certain cells according to some condition what should i do for that ?
i tried by extending the DefaultTableCellRenderer class as below:
and setting it to JTable by
but i can see the color only when i am selecting the cells . As i am new i don't know whether i am doing anything wrong..
Your comments are really really appreciated.
Thanks a lot,
Hafz