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) :
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?