I am using this code to upload several images of a gallery from a folder, the problem is that they do not all come out. I have tried to load the same repeated image and the same thing happens.
Set<Node> imagesViews = vBoxGallery.lookupAll(".img");
File imageFile;
for (final Node imgView: imagesViews) {
imageFile = new File("gallery/img/"+imgView.getId()+".jpg");
String url = imageFile.toURI().toString();
Image image = new Image(url,true);
((ImageView)imgView).setImage(image);
imgView.setOnMouseClicked(new EventHandler<MouseEvent>() {
@Override
public void handle(MouseEvent event) {
VisorImage visor = new VisorImage(((ImageView)imgView).getImage());
visor.show();
}
});
}