/home/caleb/ASDV-Java/Semester 3/Assignments/lab2_FX2_F22_part1/src/lab2_fx2_f22_part1/ImageArray1.java
/*
 * Click nbfs://nbhost/SystemFileSystem/Templates/Licenses/license-default.txt to change this license
 * Click nbfs://nbhost/SystemFileSystem/Templates/Classes/Class.java to edit this template
 */
package lab2_fx2_f22_part1;

import javafx.application.Application;
import javafx.geometry.Insets;
import javafx.scene.Scene;
import javafx.scene.image.ImageView;
import javafx.scene.layout.HBox;
import javafx.scene.layout.Pane;
import javafx.stage.Stage;

/**
 *
 * @author caleb
 */
public class ImageArray1 extends Application {

    @Override
    public void start(Stage primaryStage) throws Exception {
        final String BASE_PATH = "image/flag";
        ImageView[] images = new ImageView[] {
            new ImageView(BASE_PATH+"0.gif"),
            new ImageView(BASE_PATH+"1.gif"),
            new ImageView(BASE_PATH+"2.gif"),
            new ImageView(BASE_PATH+"3.gif"),
            new ImageView(BASE_PATH+"4.gif"),
            new ImageView(BASE_PATH+"5.gif"),
            new ImageView(BASE_PATH+"6.gif")
        };
        
        // Create a pane to hold the image views
        Pane hb = new HBox(10);
        hb.setPadding(new Insets(5, 5, 5, 5));
        
        for (int i = 0; i < 7; ++i) {
            images[i].setFitWidth(150);
            images[i].setFitHeight(100);
            hb.getChildren().add(images[i]);
        }
        // Create a scene and place it in the stage
        Scene scene = new Scene(hb);
        primaryStage.setTitle("Flags"); // Set the stage title
        primaryStage.setScene(scene); // Place the scene in the stage
        primaryStage.show();
    }
    public static void main(String[] args) {
        launch(args);
    }
    
    
    
    
    
}