title: Internal graphics not initialized yet: javafx
body: <p>I'm trying to write a <code>javaFx</code> application whit multiple images inside a window.
  <br>
  The short story is that I have an <code>enum</code> class named <code>Candy</code> and each candy has some properties and a path to the image file representing it.
  <br>
  In the constructor of my <code>javafx.application</code> class (<code>Table</code>) I want to fill an array list with those images, so I wrote this so far:
  <br></p>
  
  <pre><code>public class Table extends Application {
  
      ArrayList&lt;Image&gt; images;
  
      @Override
      public void start(Stage primaryStage) throws Exception {
          primaryStage.setTitle("CandyFx");
          primaryStage.show();
      }
  
      public Table() {
          images = new ArrayList&lt;Image&gt;();
          for (Candy candy : Candy.values()) {
              File file = new File (candy.getImagePath());
              Image image = new Image(file.toURI().toString());
              images.add(image);
          }
      }
  }
  </code></pre>
  
  <p>Now every time I want to create an instance of <code>Table</code> class, the application throws a <code>java.lang.RuntimeException: Internal graphics not initialized yet</code>.
  <br>
  How can I initial graphics which it seems I did not?</p>