title: Getting value of a Text Field from a VBox
body: <p>I am currently adding a <code>TextField</code> and a corresponding <code>ComboBox</code> dynamically every time a button is pressed. Is there a way outside of my method to then use the <code>VBox</code> (fieldContainer) variable to get the <code>TextField</code> and <code>ComboBox</code> values?</p>
  
  <p><strong>EDIT</strong></p>
  
  <p>I am creating an application in which the user can connect to a database and create a table. The scene in which the user creates the table has a <code>TextField</code> for the table name and a <code>TextField</code> for the column name with a corresponding <code>ComboBox</code> to select the column type.</p>
  
  <p><a href="https://i.stack.imgur.com/FwtKw.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/FwtKw.png" alt="create table scene"></a></p>
  
  <p>when the user clicks on add field, it generates another <code>TextField</code> and <code>ComboBox</code> bellow the current one, so now the table as two columns, etc...</p>
  
  <p>I then later want to grab the values (with the code bellow) when the user clicks create so I can organize it as a proper SQL statement.</p>
  
  <p><strong>Code</strong></p>
  
  <pre><code>addTableField.setOnAction(new EventHandler&lt;ActionEvent&gt;() {
      @Override
      public void handle(ActionEvent event) {             
          HBox box = new HBox(10);
  
          ComboBox&lt;String&gt; combo = new ComboBox&lt;String&gt;(fieldTypes);
          combo.setPromptText("type");
  
          TextField field = new TextField();
          field.setPromptText("field label");
  
          box.getChildren().addAll(field, combo);
  
          fieldContainer.getChildren().addAll(box);
          window.sizeToScene();
      }
  });
  </code></pre>