src/main/java/org/openjfx/ImageListController.java
private void prepareImageLoadingContainerList() {

        int columnCount = 3;

        for (int index = 0; index < imageState.imageFileList.size(); index++) {

            try {

                File currentFile = imageState.imageFileList.get(index);

                if (imageState.fileImageContainerHashMap.containsKey(currentFile)) {
                    continue;
                }

                int columnIndex = index % columnCount;

                int rowIndex = index / columnCount;

                StackPane stackPane = new StackPane();
                stackPane.getStyleClass().add("grid-cell");

                StringBuilder styleClasses = new StringBuilder();
                if (columnIndex == 0) {
                    styleClasses.append("first-column");
                }
                if (rowIndex == 0) {
                    styleClasses.append("first-row");
                }

                ImageView imageView = ImageUtil.getImageViewByImage(null, styleClasses.toString(), 100, 100);

                stackPane.getChildren().add(
                        imageView
                );

                Node formatLabel = new Label(String.format("%s", currentFile.getName()));

                VBox vBox = new VBox();
                vBox.getChildren().addAll(
                        formatLabel
                );

                stackPane.getChildren().add(
                        vBox
                );

                StackPane.setAlignment(vBox, Pos.CENTER);

                imageState.fileImageContainerHashMap.put(currentFile, stackPane);
                gridPane.add(stackPane, columnIndex, rowIndex);

                columnIndex++;

            } catch (Exception err) {
                err.printStackTrace();
            }
        }

    }
/**
     * Right after pick file, we generated a placeholder grid for loading all images
     * - The grid will be update cell by cell on parallel image generation stream
     */
Right after pick file, we generated a placeholder grid for loading all images
- The grid will be update cell by cell on parallel image generation stream
Right after pick file we generated a placeholder grid for loading all images - The grid will be update cell by cell on parallel image generation stream
private void prepareImageLoadingContainerList() {
        int columnCount = 3;
        for (int index = 0; index < imageState.imageFileList.size(); index++) {
            try {
                File currentFile = imageState.imageFileList.get(index);
                if (imageState.fileImageContainerHashMap.containsKey(currentFile)) {
                    continue;
                }
                int columnIndex = index % columnCount;
                int rowIndex = index / columnCount;
                StackPane stackPane = new StackPane();
                stackPane.getStyleClass().add("grid-cell");
                StringBuilder styleClasses = new StringBuilder();
                if (columnIndex == 0) {
                    styleClasses.append("first-column");
                }
                if (rowIndex == 0) {
                    styleClasses.append("first-row");
                }
                ImageView imageView = ImageUtil.getImageViewByImage(null, styleClasses.toString(), 100, 100);
                stackPane.getChildren().add(
                        imageView
                );
                Node formatLabel = new Label(String.format("%s", currentFile.getName()));
                VBox vBox = new VBox();
                vBox.getChildren().addAll(
                        formatLabel
                );
                stackPane.getChildren().add(
                        vBox
                );
                StackPane.setAlignment(vBox, Pos.CENTER);
                imageState.fileImageContainerHashMap.put(currentFile, stackPane);
                gridPane.add(stackPane, columnIndex, rowIndex);
                columnIndex++;
            } catch (Exception err) {
                err.printStackTrace();
            }
        }
    }
private void prepareImageLoadingContainerList ( ) { int columnCount = 3 ; for ( int index = 0 ; index < imageState . imageFileList . size ( ) ; index ++ ) { try { File currentFile = imageState . imageFileList . get ( index ) ; if ( imageState . fileImageContainerHashMap . containsKey ( currentFile ) ) { continue ; } int columnIndex = index % columnCount ; int rowIndex = index / columnCount ; StackPane stackPane = new StackPane ( ) ; stackPane . getStyleClass ( ) . add ( "grid-cell" ) ; StringBuilder styleClasses = new StringBuilder ( ) ; if ( columnIndex == 0 ) { styleClasses . append ( "first-column" ) ; } if ( rowIndex == 0 ) { styleClasses . append ( "first-row" ) ; } ImageView imageView = ImageUtil . getImageViewByImage ( null , styleClasses . toString ( ) , 100 , 100 ) ; stackPane . getChildren ( ) . add ( imageView ) ; Node formatLabel = new Label ( String . format ( "%s" , currentFile . getName ( ) ) ) ; VBox vBox = new VBox ( ) ; vBox . getChildren ( ) . addAll ( formatLabel ) ; stackPane . getChildren ( ) . add ( vBox ) ; StackPane . setAlignment ( vBox , Pos . CENTER ) ; imageState . fileImageContainerHashMap . put ( currentFile , stackPane ) ; gridPane . add ( stackPane , columnIndex , rowIndex ) ; columnIndex ++ ; } catch ( Exception err ) { err . printStackTrace ( ) ; } } }
Right after pick file, we generated a placeholder grid for loading all images
 - The grid will be update cell by cell on parallel image generation stream
Right after pick file we generated a placeholder grid for loading all images - The grid will be update cell by cell on parallel image generation stream