Forum Discussion

kavansays's avatar
kavansays
Contributor
10 years ago

Finding Background Color in javaFX object Table.

Hello Folks,   We are trying to automate JAVAFX Application where we are not able to identify the color of the selected row of the JAVAFX object Table.   Below is the sample code snippet that i t...
  • HKosova's avatar
    10 years ago

    Maybe the row's .getBackground().fills.get(index).fill object is what you need?

    ' Get selected row index
    rowIndex = oTable.getSelectionModel().getSelectedIndex()
    
    ' Get the row object
    Set oRow = oTable.JavaFXObject("TableRow", "", rowIndex)

    ' Index 0 seems to be row border color, 1 - row background color, but results may vary Set oFill = oRow.getBackground().fills.get(1).fill strColor = oFill.toString().OleValue ' RGBA ??? Call Log.Message(strColor) r = Round(oFill.getRed() * 255) g = Round(oFill.getGreen() * 255) b = Round(oFill.getBlue() * 255) Call Log.Message(aqString.Format("R: %i G: %i B: %i ", r, g, b))