Newsletter sign-up
View all newsletters

Enterprise Java Newsletter
Stay up to date on the latest tutorials and Java community news posted on JavaWorld

JavaWorld Daily Brew

Set color in JTable cells



Hi,

I'm new of Java graphics and I've some problems with a JTable.
I need to change the color of cells(not of the text in the cell) only for the first 5 cells in my JTable. This color should change in a jToggleActionPerform method.
I know that a CustomTableCellRenderer is necessary but how can I use it in the method?

Is there anyone who could help me?

Thanks a lot