title: Cannot convert textfield into string
body: <p>Hi I'm currenntly doing a coding exercise where I create an application with 2 views. Create in it an application with two views. The first view should have a text field that's used to ask for the user's name. The second view then shows the user a greeting text. The greeting should be of the form &quot;Welcome name!&quot; where the user's name is inserted in place of 'name'.</p>
  <pre><code>
  package application;
  
  import javafx.application.Application;
  import javafx.scene.Scene;
  import javafx.scene.control.Button;
  import javafx.scene.control.Label;
  import javafx.scene.control.TextField;
  import javafx.scene.layout.GridPane;
  import javafx.scene.layout.StackPane;
  import javafx.stage.Stage;
  
  public class GreeterApplication extends Application {
  
      public static void main(String[] args) {
          launch(GreeterApplication.class);
      }
  
      @Override
      public void start(Stage window) throws Exception {
  
          //1. Creating the view
          //1.1 Creating components to be used
          Label intro = new Label(&quot;Enter your name and start.&quot;);
          Button start = new Button(&quot;start&quot;);
          TextField input = new TextField();
  
          //1.2 creating new layout
          GridPane layout = new GridPane();
          layout.add(intro, 0, 0);
          layout.add(input, 0, 1);
          layout.add(start, 0, 2);
  
          // 1.3 Styling the layout
          //1.4 creating view itself and setting it to use the layout
          Scene first = new Scene(layout);
  
          //2. Creating new view
          StackPane welcome = new StackPane();
          String name = input.getText();
          Label welcomeText = new Label(&quot;Welcome &quot; + input + &quot;!&quot;); //inpu
          welcome.getChildren().add(welcomeText);
          Scene welcomeView = new Scene(welcome);
  
          //3. Adding event handler
          start.setOnAction((event) -&gt; {
              if (!input.getText().isEmpty()) {
                  window.setScene(welcomeView);
              }
  
          });
  
          window.setScene(first);
          window.show();
  
      }
  }
  
  </code></pre>
  <p>I tried converting input into a string via input.getText() and input.toString() but I have had no success.</p>