0

I need to test that the color of java table row has changed to some specific value. But till now I see no solutions of getting this property.

Let's assume that jTableObj is OR or DP representation of JavaTable object. So the next code works fine:

jTableObj.GetCellData(0,1)    'returns cell data e.g.: <html>Blah-blah...

How can I get color of row/cell?

1

The next code solves the problem:

Set cellRender = jTableObj.Object.getCellRenderer(0,1)

' background color '
cellRender.getBackground().toString()
    ' returns: "javax.swing.plaf.ColorUIResource[r=255,g=255,b=255]" '

' font color '
cellRender.getForeground().toString()
    ' returns: "java.awt.Color[r=255,g=255,b=180]" '

' font name, style, size '
cellRender.getFont().toString()
    ' returns: "java.awt.Font[family=Tahoma,name=Tahoma,style=italic,size=11]" '

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.