Posted Monday, June 7, 2004 @ 10:15:45
This is the code that sets the cellproperties model:
CellPropertiesModel cellModel = new myCellModel();
dBTable1.setCellPropertiesModel(cellModel);
Here is the implementation of the cellpropertiesmodel:
class myCellModel extends CellPropertiesModel {
public Color getBackground(int row, int col) {
if (row % 2 == 0)
return Color.white;
else
return Color.red;
}
public Color getForeground(int row, int col) {
if (row % 2 == 0)
return Color.black;
else
return Color.white;
}
}
Whenever it is run, the row color is the default (blue background, white letters). In addition, if I run in the debugger, I never see my methods called.
Note: refresh is called on the dbtable after the cellpropertiesmodel is set.
Stuart Naftel