In javafx you make a scene using scenebuilder and make a class that contains the FXML fields corresponding to the elements in the GUI ....Does JavaFX make an object of that class at runtime ....and if this is the case how can these fields be declared as private ??
Asked
Active
Viewed 98 times
0
-
1Please provide an example of what you have already. – Qohelet Apr 07 '20 at 20:37
-
1The `FXMLLoader` uses [reflection](https://stackoverflow.com/questions/37628/), which is capable of both [instantiating classes](https://docs.oracle.com/en/java/javase/14/docs/api/java.base/java/lang/reflect/Constructor.html#newInstance(java.lang.Object...)) and [setting private fields](https://docs.oracle.com/en/java/javase/14/docs/api/java.base/java/lang/reflect/Field.html#set(java.lang.Object,java.lang.Object)). – Slaw Apr 07 '20 at 21:32