title: javaFX Frame image
body: <p>I am trying to use javaFX to create a window that displays images
  one at a time for a certain duration of time 
  I am not able to get the image to loop or display </p>
  
  <p>the vbox shows up empty </p>
  
  <p>This was my last attempt at getting the vbox child added to the vbox</p>
  
  <p>Any with ideas? I've been stuck on this for hours</p>
  
  <pre><code>package digitalframe;
  
  import javafx.animation.KeyFrame;
  import javafx.animation.Timeline;
  import javafx.application.Application;
  import javafx.event.ActionEvent;
  import javafx.event.EventHandler;
  import javafx.geometry.Pos;
  import javafx.scene.Scene;
  import javafx.scene.control.Label;
  import javafx.stage.Stage;
  import java.util.*;
   import javafx.scene.image.Image;
  import javafx.util.Duration;
  import java.util.ArrayList;
  import javafx.scene.image.ImageView;
  
  import javafx.scene.layout.VBox;
  
  
  
  public class DigitalFrame extends Application {
  
  @Override
  public void start(Stage stage) throws Exception {
  
      final ArrayList imageList = new ArrayList&lt;&gt;();
  
      imageList.add(new ImageView("1.jpg"));
      imageList.add(new ImageView("2.jpg"));
      imageList.add(new ImageView("3.jpg"));
  
      // Create the label and align its contents
      final VBox vBox = new VBox();
  
      vBox.setAlignment(Pos.CENTER);
  
      // This is the keyframe handler.
      class ImageHandler implements EventHandler&lt;ActionEvent&gt; {
  
          @Override
          public void handle(ActionEvent event) {
  
              for (int n = 0; n &gt; imageList.size(); n++) {
  
                  vBox.getChildren().add(new ImageView());
  
              }
  
          }
  
      }
  
      // Build the keyframe.
      Duration sec = new Duration(1000);
  
      ImageHandler image = new ImageHandler();
  
      KeyFrame keyFrame = new KeyFrame(sec, image);
  
      // Build the time line animation.
      Timeline timeline = new Timeline(keyFrame);
      timeline.setCycleCount(15);
  
      // Set the stage and show, and play the animation
      stage.setScene(new Scene(vBox, 250, 300));
      stage.setTitle("Animation Counter");
      stage.show();
      timeline.playFromStart();
  }
  
   // @param args the command line arguments
  public static void main(String[] args) {
      launch(args);
  }
  
  }
  </code></pre>