title: JavaFX Two steps Registration Form
body: <p>I’m going to build two steps registration form using JavaFX. Anyone has an idea how can pass the first controller inputs to the second one. And how can I use those values on action events to update my database?</p>
  <p>Here is how I connect my first scene to the second one. And send my inputs to the second scene controller.</p>
  <pre><code>public void btnNextPage(){
  
      try{
          Parent fxml = FXMLLoader.load(getClass().getResource(&quot;stdReg2.fxml&quot;));
          FXMLLoader loader=new FXMLLoader(getClass().getResource(&quot;stdReg2&quot;));
          //Parent root = (Parent) loader.load();
  
          StdReg2 stdreg2=loader.getController();
          stdreg2.getTexts(txtFirstName.getText(),txtStdid.getText(),txtLastName.getText(),txtBd.getEditor().getText(),txtUsrEmail.getText(),txtUsrPass.getText(),img);
          //Parent fxml = FXMLLoader.load(getClass().getResource(&quot;stdReg2.fxml&quot;));
          contentArea.getChildren().removeAll();
          contentArea.getChildren().setAll(fxml);
  
          //StdReg2 stdreg2=fxml.getConroller();
  
      } catch (IOException ex){
          Logger.getLogger(Dashboard.class.getName()).log(Level.SEVERE, null, ex);
          System.out.println(ex);
      }
  </code></pre>
  <p>Here how I get first controller inputs to the second controller.</p>
  <pre><code>public void getTexts(String txtFirstName,String txtStdid, String txtLastName, String txtBd, String txtUsrEmail, String txtUsrPass, File img) throws FileNotFoundException {
  
  
      String firstname = txtFirstName;
      String lastname = txtLastName;
      String emid = txtStdid;
      String usrBD = txtBd;
      String usrEmail = txtUsrEmail;
      String usrPass = txtUsrPass;
  
  }
  </code></pre>
  <p>My issue is, How can I use this input on my action event and add first controller data and second controller data to my database because I can't use those attributes in another method on the second controller.</p>
  <p>Thank you, have a nice day. </p>