I'm now trying for hours but I do not get it...
My app should show some images inside a GridView
.
The amount of columns is defined/configurable. Now I want to distribute the images to use all width, and use the scrollpane to scroll down. I'm sure this is easy to achieve but somehow I struggle.... Thanks very much!
My tries using
view.setFitWidth(scrollpane.getWidth()/max_cols)
and similar failed...
int imagesShown=0;
for(ImageObject i : images){
int row = (int)Math.floor(imagesShown/max_cols)+1;
int col = imagesShown - (row-1)*max_cols + 1;
imagesShown++;
imageGridPane.add(i.view, col, row);
}