I have 5 GridPane that I need to make visible / invisible depending on certain circumstances. I have tried to store them in an ObservableList but when trying to access them to apply the method .setVisible gives error, since when accessing the index it returns null instead of the gridpane in question. Porfa Help: (
@FXML
private GridPane fila1;
@FXML
private GridPane fila2;
@FXML
private GridPane fila3;
@FXML
private GridPane fila4;
@FXML
private GridPane fila5;
@FXML
ObservableList<GridPane> mesas = FXCollections.observableArrayList(fila1,fila2,fila3,fila4,fila5);
for(int i=0;i<temp.getEmpleados().size();i++) {
mesas.get(i).setDisable(false);
}