0

I have list, in javaFx, to populate with pretty complex elements. I have defined created fxml layout for each element. Is there any way for me to initialize this fxml files as elements in list which I have also defined in fxml? Also I would like to populate elements in each element of list with individual values.

I know there's a option to create these elements from code, but i would prefer to initialize them from fxml.

  • 2
    It's not really clear where you are stuck. Just load the FXML as often as you need and add the resulting UI element to some pane. You can pass values to each of the controllers in the [usual way](https://stackoverflow.com/questions/14187963/passing-parameters-javafx-fxml). – James_D Apr 23 '18 at 14:42
  • Not sure if this is what you're asking for but you can create a list of elements created from a fxml file by using `` elements as children for the list element. – fabian Apr 23 '18 at 14:45
  • I think OP wants to make a parent fxml file with multiple children fxml files included with , probably each fxml file with its own controller. @OP: yes that’s doable. The trick is to add the fx:id to the fx:include statement whereby the fx:id has to follow the Java naming convention. – benji2505 Apr 23 '18 at 23:15
  • What I meant was parent stage defined in fxml, and elements defined in other fxml added from java code to first stage. @James_D your idea works, maybe make answer with that? – Kuba Sienek Sienkiewicz Apr 24 '18 at 06:09

0 Answers0