title: Working on Creating Image Gallery in JavaFX. not able to display image properly
body: <p>I am creating image gallery using javafx. I found many things on internet regarding this but not able to get any suitable help for this issue. I have to create one image gallery like picasa viewer. all the images is in thumbnail view in my image view and after that when I select image that is in pop-up viewer. I did it some code for that but I didn't get proper output. All the images from the folder redraw from the same co-ordinates.
  Below is my code and output.</p>
  
  <pre><code>@Override
  public void initialize(URL url, ResourceBundle rb) {
  
      String path = "/home/ubuntu/eclipse with liferay/Desktop/imagetest/";
  
      File folder = new File(path);
      File[] listOfFiles = folder.listFiles();
  
      for (final File file : listOfFiles) {
  
              ImageView imageView;
              imageView = createImageView(file);
              imagecontainer.getChildren().addAll(imageView);
  
      }
  
  }
   private ImageView createImageView(final File imageFile) throws FileNotFoundException, FileNotFoundException, FileNotFoundException, FileNotFoundException {
      // DEFAULT_THUMBNAIL_WIDTH is a constant you need to define  
      // The last two arguments are: preserveRatio, and use smooth (slower) resizing  
  
      ImageView imageView = null;
      try {
  
          final Image image;
  
          image = new Image(new FileInputStream(imageFile), DEFAULT_THUMBNAIL_WIDTH, 0, true, true);
          imageView = new ImageView(image);
  
      } catch (FileNotFoundException ex) {
          Logger.getLogger(GalleryController.class.getName()).log(Level.SEVERE, null, ex);
      }
      return imageView;
  
  }
  
  }
  </code></pre>
  
  <p><img src="https://i.stack.imgur.com/K2hp8.png" alt="output"></p>
  
  <p>kindly help me to resolve my issue. I want to display images one by one as thumbnail view. </p>