How using JavaFx to create a dynamic application?

For example, there is a very simple application:

How this can be done on JavaFX?

I can "impose" such a thing to FXML is not difficult. But I can only do that with a specific number of rows and columns. But as you can see, in this application, you can dynamically change the number of rows and columns.

How to do that in JavaFx?
March 19th 20 at 09:00
1 answer
March 19th 20 at 09:02
so, an excerpt from your
ImageCustom imageCustom = new ImageCustom();

 imageCustom.setURL(strExport + resultSet.getString("id").trim() + strJPG);
 imageLayout.add(imageCustom, 0, imageLayout.getChildren().size()); // here is what you need

then dynamically create an object by clicking user
Is it possible to do this without resorting to objects.
In principle, it is clear that it can be done.
But the structure of the elements can be quite complicated, you may need to change it or to make a completely different.

In General, I mean this:

Language, though different, but the essence is exactly the same.

Is not there some template engines?

Or at least the way the fxml from string to objects. In HTML it is always possible from an html string to create the objects. But in JavaFx I have not found such. And indeed the class that loads the fxml parsing it yourself (although it would be logical that there was a class for parsing, which could be used).

Just in case the template you just need to write the string fxml (or almost), pass it and the new data to the template and to obtain new elements or modify old items. - ruby_Krajcik54 commented on March 19th 20 at 09:05
@ruby_Krajcik54, XS, I was given enough - helena54 commented on March 19th 20 at 09:08
@ruby_Krajcik54, you can use the FXMLLoader.load, it will return the root panel.
Rough example:
AnchorPane anchorPane = FXMLLoader.load(Main.class.getResource("view/ListenerItem.fxml"));
 ImageView photo = (ImageView) anchorPane.getChildren().get(0);
 Label fullName = (Label) of the anchorPane.getChildren().get(1);
- willa_Kuhn64 commented on March 19th 20 at 09:11

Find more questions by tags JavaFXJava