imageGrid = new GridPane();
imageGrid.prefWidthProperty().bind(gallerie.widthProperty().multiply(1.00));
imageGrid.prefHeightProperty().bind(gallerie.heightProperty().multiply(0.9));
imageGrid.setPadding(new Insets(20, 20, 20, 20));
imageGrid.setHgap(20);
imageGrid.setVgap(20);
imageGrid.setStyle("-fx-background-color: #154BE5");
... ... ...
static void loadCurrentImages(ArrayList<File> imageFiles) {
ArrayList<ImageView> ivs = new ArrayList<>();
int i = 0;
int k = 0;
int j = 0;
for (File f : imageFiles) {
ImageView iv = new ImageView();
iv.setFitWidth(100);
iv.setPreserveRatio(true);
iv.setSmooth(true);
iv.setImage(new Image(f.toURI().toString()));
ivs.add(iv);
imageGrid.add(ivs.get(i), k, j);
i++;
k++;
if(k > imageGrid.widthProperty().intValue() / 100){ //???????
k = 0;
j++;
}
}
}
in the last if clause I want to use the current size of the grid but i have no idea how to gtet it because itself its bound to another size (gallerie)
i want to get the current int value