title: Back to previous screen in javafx with send value
body: <p>I use javafx in intellij IDE.I think it may be Repetitious but I did not see solution. 
  When I click to setchange Button on screen I want to close screen and back to previous screen but it open new screen 
  and as you see save value to first textfield screen.I want a solotion with fxml GUI rather than javafx code. Thanks</p>
  
  <p>Main.java:</p>
  
  <pre><code>public class Main extends Application {
  
  @Override
  public void start(Stage primaryStage) throws Exception{
      Parent root = FMLLoader.load(getClass().getResource("sample1.fxml"));
      primaryStage.setScene(new Scene(root, 600, 400));
      primaryStage.show();
  }
  
  public static void main(String[] args) {
      launch(args);
  }
  }
  </code></pre>
  
  <p>Sample1Controller.java</p>
  
  <pre><code>public class Sample1Controller {
  @FXML
  private Button btn1;
  @FXML
  private TextField text1;
  
  void initData(String s) {
      text1.setText(s);
  }
  
  @FXML
  private void handleButtonAction(ActionEvent event) throws IOException {
  
      FXMLLoader loader = new FXMLLoader(getClass().getResource("sample2.fxml"));  
      Stage stage = new Stage();
      stage.setScene(new Scene((Parent) loader.load()));
      stage.show();
  }
  }
  </code></pre>
  
  <p>Sample2Controller.java</p>
  
  <pre><code>public class Sample2Controller {
  @FXML
  public Button btn2;
  @FXML
  public TextField text2;
  @FXML
  public Label lbl;
  String string;
  @FXML
  
  private void handleButtonAction(ActionEvent event) throws IOException {
      string = text2.getText();
      FXMLLoader loader = new FXMLLoader(getClass().getResource("sample1.fxml"));
      Stage stage = new Stage();
      stage.setScene(new Scene((Parent) loader.load()));
      Sample1Controller controller =
              loader.getController();
      controller.initData(string);
      stage.show();
  }
  }
  </code></pre>
  
  <p>sample1.fxml
      </p>
  
  <pre><code>&lt;?import javafx.scene.control.Button?&gt;
  &lt;?import javafx.scene.control.Label?&gt;
  &lt;?import javafx.scene.control.TextField?&gt;
  &lt;?import javafx.scene.layout.AnchorPane?&gt;
  
  &lt;AnchorPane maxHeight="-Infinity" maxWidth="-Infinity" minHeight="-   Infinity" minWidth="-Infinity" prefHeight="400.0" prefWidth="600.0"  xmlns="http://javafx.com/javafx/8.0.76-ea" xmlns:fx="http://javafx.com/fxml/1" fx:controller="sample.Sample1Controller"&gt;
      &lt;children&gt;
      &lt;Button fx:id="btn1" layoutX="246.0" layoutY="135.0" mnemonicParsing="false" onAction="#handleButtonAction" text="go to scene 2 " /&gt;
      &lt;Label layoutX="259.0" layoutY="229.0" text="this is scene 1" /&gt;
      &lt;TextField fx:id="text1" layoutX="216.0" layoutY="285.0" /&gt;
  &lt;/children&gt;
  &lt;/AnchorPane&gt;
  </code></pre>
  
  <p>sample2.fxml
      </p>
  
  <pre><code>&lt;?import javafx.scene.control.Button?&gt;
  &lt;?import javafx.scene.control.Label?&gt;
  &lt;?import javafx.scene.control.TextField?&gt;
  &lt;?import javafx.scene.layout.AnchorPane?&gt;
  
  &lt;AnchorPane maxHeight="-Infinity" maxWidth="-Infinity" minHeight="-Infinity" minWidth="-Infinity" prefHeight="400.0" prefWidth="600.0" style="-fx-background-color: tan;" xmlns="http://javafx.com/javafx/8.0.76-ea" xmlns:fx="http://javafx.com/fxml/1" fx:controller="sample.Sample2Controller"&gt;
  &lt;children&gt;
    &lt;Button fx:id="btn2" layoutX="269.0" layoutY="200.0" mnemonicParsing="false" onAction="#handleButtonAction" text="SetChange" /&gt;
    &lt;Label layoutX="269.0" layoutY="137.0" text="This is scene 2" /&gt;
    &lt;TextField fx:id="text2" layoutX="226.0" layoutY="261.0" /&gt;
  &lt;/children&gt;
  &lt;/AnchorPane&gt;
  </code></pre>