Skip to content Skip to sidebar Skip to footer

Fxml, Script Tag And Initialize Method

I am testing and discovering JavaFX. In JavaFX FXML documentation about controllers, it is said that if the controller has a public void initialize() method, it is called once the

Solution 1:

I think the scripts in the fxml will just be executed inline just like they are in HTML. So you don't place the script statements to be executed inside any function.

See this fxml+JavaScript metronome application for a sample.

Solution 2:

The controller must also implement the javafx.fxml.Initializable interface. for the initialize method to be called. The code example of a controller shows this but the description is not very clear.

I'm not sure about the FXML scripting.

Post a Comment for "Fxml, Script Tag And Initialize Method"