I'm trying to send value from Scene A to Scene B. any Idea how to get it done? Also, without opening scene B if it already opened. Thanks
Asked
Active
Viewed 43 times
-1
-
1What type of values do you want to send? Also please provide [minimal reproducible example](https://stackoverflow.com/help/minimal-reproducible-example) – Mayur Patel Aug 08 '19 at 06:32
-
1Possible duplicate [Passing Parameters Javafx FXML](https://stackoverflow.com/questions/14187963/passing-parameters-javafx-fxml). – Robert Aug 08 '19 at 09:30
-
Possible duplicate of [Passing Parameters JavaFX FXML](https://stackoverflow.com/questions/14187963/passing-parameters-javafx-fxml) – Mayur Patel Aug 09 '19 at 04:58
1 Answers
0
It depends on what type of value it is and if the Scene's are in different classes. But if you were sending the value of a Text
object in one scene to another Text
object in another scene for instance, then using something like this may help:
Text sceneAvalue = new Text("Scene A value");
Text sceneBvalue = new Text(sceneAvalue.getText());
//add sceneBValue to Scene B however you usually add components to a scene

Mary X
- 153
- 2
- 15