title: JavaFX TextField wont Update Text
body: <p>Basically, I have a pop-up display that has a textfield I want the user to type a name into (then I eventually get the name and use it later but that doesn't matter). Unfortunately, the text in the textfield doesn't update (graphically, the program can still get what was typed through tf.getText(), but I can't see the text updating).</p>
  
  <pre><code>    Stage window = new Stage();
      window.initModality(Modality.APPLICATION_MODAL);
      window.setTitle("Naming");
      window.setMinWidth(300);
      window.setMinHeight(200);
      Label label = new Label();
      label.setText("Please type a name");
      Button submitButton = new Button("Submit");
      TextField tf = new TextField();
      tf.setText("Please enter a name");
      tf.setMaxWidth(200);
      submitButton.setOnAction(e -&gt;{
          System.out.println(tf.getText());
          window.close();
      });
      VBox layout = new VBox(10);
      layout.getChildren().addAll(label, submitButton, tf);
      Scene scene = new Scene(layout);
      window.setScene(scene);
      window.showAndWait();
  </code></pre>
  
  <p>The issue can be fixed through changind <code>window.showAndWait();</code> to just <code>window.show()</code>, but I'm wondering if it can also be resolved some other way.</p>