title: JavaFX TextField Auto-suggestions
body: <p>I want to make this TextField have suggestions feature just like in Lucene. I've searched all the web and I just find it for ComboBox.</p>
  
  <pre><code>TextField instNameTxtFld = instNameTxtFld();
  
  private TextField instNameTxtFld() {
      TextField txtFld = new TextField();
      txtFld.setPrefSize(600, 75);
      return txtFld;
  }
  </code></pre>
  
  <p>The reason that I can't use the method for ComboBox is because I can't input the value to database below if I use ComboBox.</p>
  
  <pre><code>private void goNext() {
  
      if (nameTxtFld.getText() == null || nameTxtFld.getText().trim().isEmpty()
              || instNameTxtFld.getText()== null || instNameTxtFld.getText().trim().isEmpty()
              || addTxtArea.getText() == null || addTxtArea.getText().trim().isEmpty()) {
          alertDialog.showAndWait();
      } else {
          String satu = idNumTxtFld.getText();
          String dua = nameTxtFld.getText();
          String tiga = addTxtArea.getText();
          String empat = instNameTxtFld.getText();
          int delapan = idType.getSelectionModel().getSelectedIndex();
          String sembilan = timeStamp.getText();
          try {
              KonekDB.createConnection();
              Statement st = KonekDB.conn.createStatement();
              String sql = "INSERT INTO privateguest"
                      + "(idNumber, name, address, institution, idType, startTime) "
                      + "VALUES "
                      + "('" + satu + "','" + dua + "','" + tiga + "','" + empat + "','" + delapan + "','" + sembilan + "')";
  
              System.out.println(sql);
              st.executeUpdate(sql);
  
          } catch (SQLException ex) {
  
              System.out.println(satu + " " + dua + " " + tiga + " " + empat + " " + delapan + " " + sembilan);
              System.out.println("SQL Exception (next)");
              ex.printStackTrace();
          }
          Frame3Private frame3 = new Frame3Private(english);
          this.getScene().setRoot(frame3);
      }
  
  }
  </code></pre>
  
  <p>Please help me to make the most simple code for doing TextField suggestions/ auto-complete.</p>