Answer the question
In order to leave comments, you need to log in
How to split code into several controls in javafx?
Good!
How to set several in one Sample.fxml
fx:controller="controller.Controller"well, then I dump everything into one controller, it’s extremely inconvenient
public class Controller implements Initializable {
@FXML
TextFieldId ....
.....
Answer the question
In order to leave comments, you need to log in
In your main fxml, write the connection of child fxml
For example, you make one main fxml in it, create some kind of vbox
, set the vbox cells to a fixed size and connect window elements spaced apart by different controllers
So connect the child fxml-ku
In the child fxml, specify the fx:controller parameter, which will refer to the child controllers,
I didn’t explain very clearly if it doesn’t work, write an example
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question