JTable cell color change Single METHOD

I searched the forum but I could not find a method that is something like changer(int row,int column, Color color).

the examples show that I should rewrite a method of a class which is derived from defaultTableCellRenderer. In that case as I understand I should wire the algorithm to change the cells in rewritten method. I do not want that...

I would be grateful if you can help me/help writing me a method that will change the cell color according to parameters.

[483 byte] By [Cosaia] at [2007-11-27 11:52:03]
# 1

Unfortunately there is no such method. and besides, learning how to use the CellRenderer now will be much use to you in the future. Imagine you do not want to change just one cell color but several and this should be done based on certain cell values at certain times in your program. Now how many "changeCellColor(int row, int col, Color c)' calls do you think you'd have to make to achieve this, and how clean will your code be?

See "How to Use Tables" (section on cell renderers) http://java.sun.com/docs/books/tutorial/uiswing/components/table.html#renderer

ICE

icewalker2ga at 2007-7-29 18:42:01 > top of Java-index,Desktop,Core GUI APIs...
# 2

> I searched the forum but I could not find a method that is something like....

No, but there are plenty of postings that show you how to use a renderer to color a cell. So if you need more help after reading the tutorial you can search the forum again.

camickra at 2007-7-29 18:42:01 > top of Java-index,Desktop,Core GUI APIs...