I suggest using a for loop to get the children of the "lines" array, and then using "-fx-stroke:", as ItachiUchiha suggested, but adding color to the line.
Here is the code:
public void setColor(String color) {
for (Line line:lines){
line.setStyle("-fx-stroke:"+ color);
}
}
Hope this helps. If you have a question, just ask.
source
share