Not all images are uploaded to JavFX

0

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();
            }
        });
    }
    
asked by Francisco Javier Peña Veitia 17.01.2018 в 19:34
source

0 answers