title: Why does adding a TextField to my JavaFX cause multiple exceptions?
body: <p>I am attempting to create multiple JavaFX applications and have had no issues until now when I attempt to add a <code>TextField</code>. I can have a brand new file and include a single line initializing a <code>TextField</code> and it will cause the exceptions. I have looked all over online and got nothing. Simply adding the TextField causes the exceptions to appear even in other, previously running,k programs. Examples below: </p>
  
  <p><a href="https://i.stack.imgur.com/Ele2N.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/Ele2N.png" alt="Error Image"></a>  </p>
  
  <p>The program I have created so far:</p>
  
  <pre><code>public class CH16Q04 extends Application {
      public static void main(String[] args) {
          launch(args);
      }
  
      @Override
      public void start(Stage primaryStage) {
          VBox masterPane = new VBox();
          HBox milesPane = new HBox();
          HBox kiloPane = new HBox();
  
  
          javafx.scene.control.TextField milesTF = new TextField("Miles: ");
          milesTF.setAlignment(Pos.BASELINE_RIGHT);
          javafx.scene.control.TextField kiloTF = new TextField("Kilometers" );
          kiloTF.setAlignment(Pos.BASELINE_RIGHT);
  
          milesPane.getChildren().addAll(new Label("Miles: "), milesTF);
          kiloPane.getChildren().addAll(new Label("Kilometers: "), kiloTF);
          masterPane.getChildren().addAll(milesPane,kiloPane);
          BigDecimal milesInput = new BigDecimal(milesTF.getText());
          BigDecimal kiloInput = new BigDecimal(kiloTF.getText());
  
          milesTF.setOnAction(e -&gt; {
  
              kiloTF.setText((milesInput.multiply(new 
              BigDecimal("1.609344")).toString()));
              kiloTF.setStyle("-fx-text-fill: red");
          });
  
          kiloTF.setOnAction(e -&gt; {
  
              milesTF.setText(kiloInput.multiply(new 
              BigDecimal("0.621371")).toString());
              milesTF.setStyle("-fx-text-fill: red");
          });
  
  
          Scene scene = new Scene(masterPane);
          primaryStage.setTitle("Chapter 16, Question 04");
          primaryStage.setScene(scene);
          primaryStage.show();
  
      }
  }
  </code></pre>