I found a few moments this morning to adapt the above suggestion into my test table.
Here is the sample code:
def configureCell([...]):
from javax.swing import BorderFactory
from java.awt import Color
if rowIndex == 0 and colIndex == 0:
border = BorderFactory.createMatteBorder(8, 8, 1, 4, Color(255, 255, 255))
elif rowIndex == (self.data.rowCount-1) and colIndex == 0:
border = BorderFactory.createMatteBorder(1, 8, 8, 4, Color(255, 255, 255))
elif rowIndex == 0 and colIndex == (self.data.columnCount-1):
border = BorderFactory.createMatteBorder(8, 4, 1, 8, Color(255, 255, 255))
elif rowIndex == (self.data.rowCount-1) and colIndex == (self.data.columnCount-1):
border = BorderFactory.createMatteBorder(1, 4, 8, 8, Color(255, 255, 255))
elif rowIndex == (self.data.rowCount-1) and colIndex == 0:
border = BorderFactory.createMatteBorder(1, 8, 8, 4, Color(255, 255, 255))
elif rowIndex == 0:
border = BorderFactory.createMatteBorder(8, 4, 1, 4, Color(255, 255, 255))
elif rowIndex == (self.data.rowCount-1):
border = BorderFactory.createMatteBorder(1, 4, 8, 4, Color(255, 255, 255))
elif colIndex == 0:
border = BorderFactory.createMatteBorder(1, 8, 1, 4, Color(255, 255, 255))
elif colIndex == (self.data.columnCount-1):
border = BorderFactory.createMatteBorder(1, 4, 1, 8, Color(255, 255, 255))
else:
border = BorderFactory.createMatteBorder(1, 4, 1, 4, Color(255, 255, 255))
if selected:
return {'background': self.selectionBackground, 'border': border}
elif rowView % 2 == 0:
return {'foreground': 'white', 'background': Color(0, 0, 0), 'border': border}
else:
return {'foreground': 'white', 'background': Color(150, 150, 150), 'border': border}
Here is the result: