There is a GridPane. In it, objects of type - label. What are the ways to get these labels?

UPD Found such a thing:

Label l = (Label) GridPane.getChildren().get(16); 

But the bottom line is that I have 6 columns, in the first column I will have the name of something there and I want to get the right line for this column.

  • one
    Use an ordinary collection iterator and loop through all the Label. method - public void forEach (Consumer <? super T> action) - Germes

1 answer 1

The GridPane class method - getChildren () returns a reference to the panel collection.