Change row color of table

Is it possible to change color of row of a table depending on a column value?
If so? can someone guide me how to do it?

Thank you.

Yes.

I like creating a custom property on the table of type Color. In this case, I named it ā€œSomeColorā€
In the configureCell extension function of the table:

# I am checking to see if the Boolean Column is true
isChecked = self.data.getValueAt(rowIndex,"Boolean Column")
	if isChecked:
		return {'background':self.SomeColor}
1 Like

Hi Jae,

Thank you for the response.
By configureCell extension you mean "getBackgroundAt? "

Thanks!

this was the error i had after implementing what you suggested.

ERROR [Table-AWT-EventQueue-0] Enable to cast return value {ā€˜background’: java.awt.Color[r=255,g=255,b=255]} to class java.awt.Color.
java.lang.ClassCastException: Cannot coerce value ā€˜{ā€˜background’: java.awt.Color[r=255,g=255,b=255]}’ into type: class java.awt.Color

Double click on the table to open the table customizer, click on the tab at the top for ā€˜Background Color Mapping’, select the column you want to monitor in the dropdown list, set the color at the bottom for different values.

I did that, did not work.

Are you using the regular table or power table?

oh i was using the normal table, i switched to power. its working now. thanks!