I'm learning how to build windows apps using JavaFX. I was wondering if JavaFX has something similar to Angular's OnInit function where I can make method calls before the view is actually loaded.
Asked
Active
Viewed 233 times
1
-
Java has [initialization blocks](https://stackoverflow.com/q/3987428/2970947). – Elliott Frisch Jan 31 '18 at 00:03
-
https://docs.oracle.com/javase/8/javafx/api/javafx/application/Application.html – Alexander Staroselsky Jan 31 '18 at 00:07
-
You can write something in the constructor. Or, you can write a method to call it before having your view shown. – Nin Jan 31 '18 at 00:12
-
I'm actually navigating to the view from the root view, so I wrote a method to get/set the info that was needed, that could then be called while setting up the view. – therealdakotal Jan 31 '18 at 00:45