JTable color row, based on info outside the table
Hi everybody,
I have an object called "Event" which I visualize in a JTable. I create the Object[][] data array for the JTable like this:
// Convert the events to table data.
Object data[][] =new Object[p_events.size()][6];
int i = 0;
for (Event event : p_events)
{
if (event.hasSubject()) data[i][0] = Library.replaceNSforPrefix(event.getSubjectURI());
data[i][1] = Library.replaceNSforPrefix(p_relationURI);
if (event.hasObject()) data[i][2] = Library.replaceNSforPrefix(event.getObjectURI());
data[i][3] = event.isPartial();
data[i][4] = event.isValid();
data[i][5] = event.numberOfNewsItems();
++i;
}
I pass this array to my table model in order to create a model which is used for the JTable. Now I have the following problem: I want to color a row red based on a certain attribute of the Event object of that respective row. However, that attribute is not visualized in the table. How can I best go about doing such a thing?
Best regards,
Jethro

