Как я могу получить TextField из внутренней стадии в JavaFX?

Я написал контроллер для двух окон / этапов. Первое окно открывается в MainClass. Второй в контроллере, если пользователь нажимает на кнопку. Как я могу получить TextFields из second.fxml в методе applyFor ()?

Благодарю.

@FXML
    protected void requestNewAccount(ActionEvent event) {
        try {
            FXMLLoader fxmlLoader = new FXMLLoader(getClass().getResource("second.fxml")); // TextFields in there
            Parent root = (Parent) fxmlLoader.load();
            Stage stage = new Stage();
            stage.initModality(Modality.APPLICATION_MODAL);
            stage.setTitle("Second Window");
            Scene scene = new Scene(root);
            String css = MainOnlineCustomer.class.getResource("/style.css").toExternalForm();
            scene.getStylesheets().clear();
            scene.getStylesheets().add(css);
            stage.setScene(scene);
            stage.show();
        } catch (IOException e) {
            logger.error(e);
        }
    }

    /**
     * closes the "second"-Window
     * @param event
     */
    @FXML
    protected void cancel(ActionEvent event) {
        final Node source = (Node) event.getSource();
        final Stage stage = (Stage) source.getScene().getWindow();
        stage.close();
    }

    @FXML
    protected void applyFor(ActionEvent event) {
        // get values from TextField in second.fxml here!!!
    }

Ответы на вопрос(1)

Ваш ответ на вопрос