0

I'm trying to add nodes from separate fxml file to scroll pane but I'm failing to edit each node in the run, the result is the same look of every node in scroll pane. Here is the code :

  private void refreshNodes()
{
    pnl_scroll.getChildren().clear();

    Node [] nodes = new  Node[15];

    for(int i = 0; i<10; i++)
    {
        try {
            nodes[i] = (Node)FXMLLoader.load(getClass().getResource("/fxml/Item.fxml"));

            //I need to edit each node, to set data on certain labels by their fx:id, I tried but failed

            pnl_scroll.getChildren().add(nodes[i]);

        } catch (IOException ex) {
            Logger.getLogger(HomeController.class.getName()).log(Level.SEVERE, null, ex);
        }

    }
}

Here is the look of the node(Item.fxml) : enter image description here

How can I access for example "Quote in progress" label from the node so that I can set different text on it in the run?

therealsowho
  • 133
  • 1
  • 7
  • 1
    Does this answer your question? [Passing Parameters JavaFX FXML](https://stackoverflow.com/questions/14187963/passing-parameters-javafx-fxml) – Slaw Jan 09 '20 at 06:43
  • Also related: [Accessing FXML controller class](https://stackoverflow.com/questions/10751271/accessing-fxml-controller-class). – Slaw Jan 09 '20 at 06:43

0 Answers0