Have multiple FXML files (created in SceneBuilder), but only one controller. Does each scene load its own copy of the controller?

I have several FXML files that I created in SceneBuilder and one controller file. When I edit a value (such as an integer value) in one scene and then switch scenes, that value does not seem to have been changed in the new scene.

When loading an fxml file for a scene, does my program download a copy of the controller file only for (and used only) for this fxml file?

Really appreciate any help you guys can answer this question.

+5
source share
1 answer

Java, Java, Java.

fxml factory (.. ), , fxml .

fxml , , , .

, fxml, - , fxml, .


,

, , .

JavaFX FXML

, . @FXML, .

fxml, :


. FXML.

:

, FXMLLoader#setController() FXMLLoader#setControllerFactory().

, :

+15

All Articles