Multiple controller for one FXML file


Question

I have one fxml file controlled by one controller. I want to separate the controller into multiple parts as if placed in one controller makes a long code. Unfortunately, fx:controller can only be placed in the root. Are there any suggestions for me how to separate the controller?

1
4
6/2/2013 4:38:31 AM

Accepted Answer

I recommend to create custom controls - use several smaller FXML files rather than one big FXML file.

Here is the tutorial:

http://docs.oracle.com/javafx/2/fxml_get_started/custom_control.htm

9
6/2/2013 11:33:41 AM

You can add an fxml file as a node into another fxml , both with diferent controllers with include option in scene builder


Licensed under: CC-BY-SA with attribution
Not affiliated with: Stack Overflow
Icon