JavaFx: how to reference main Controller class instance from CustomComponentController class?

前端 未结 2 887
清歌不尽
清歌不尽 2021-01-15 19:08

WHAT I HAVE is a standard JavaFX application: Main.java, MainController.java & main.fxml. To add custom component, I created CustomComponentController

2条回答
  •  南方客
    南方客 (楼主)
    2021-01-15 19:15

    Your problem looks like the classic catalog-crud forms updating, I implemented an interface that I called Updatable with an update method so I could reference any catalog form with any crud form easy after passing Controller Main Class as the UserData Property of the Child Root Component's Form

    Hope it Can Solve your problem

提交回复
热议问题