Power Table Customisation

I have used a power table and want to highlight the outer border when selected. So on the power table, I have done the scripting. When any cell is selected I want the whole row displayed with the orange border and its thickness should be 3 px. In the configure cell I have written the below script

if selected == True:
		from java.awt import Font 
		from javax.swing import SwingConstants 
		from javax.swing.border import LineBorder 
		return {'background': '#281C08','foreground': '#FF8C35', 'text':value, 'toolTipText':value, 'border': LineBorder(system.gui.color(241, 122, 44), 3)}
	elif self.data.getValueAt(rowIndex,"CRANE SEQ STATUS") == 'COMPLETED':
		return  {'background': '#474747','foreground': '#8C918E', 'text':value, 'toolTipText':value}
	elif self.data.getValueAt(rowIndex,"CRANE SEQ STATUS") == 'IN PROGRESS':
		return  {'background': '#281C08','foreground': '#FF8C35', 'text':value, 'toolTipText':value}

But all the cell's border gets this code I want only the outside border of the row to be in the orange color.

Any suggestion guys?

You should write border as a BorderFactory. Then you are able to modify specific borders.

Here is an example I found:

Hope this helps

1 Like

I have gone through this solution but border is applied to the particular cell and not the whole row. I wanted if I select a particular cell then whole row should be selected.

What about aplying it to the whole row? even if you only select one particucalr cell?

IIRC, the row doesn't exist as a distinct Swing object that can be styled.

1 Like

You'll have to apply a selective border. If the column index is 0 or equal to the column count, then apply the appropriate edge border (left or right). Other wise, always apply just a Top and Bottom border.

2 Likes