Nested controller issue in Java FX

前端 未结 1 1148
时光取名叫无心
时光取名叫无心 2020-12-04 03:00

I\'m trying to include controller(SelectedIssueController) in my main layout (main.fxml). But I get the following error:

Can not set lt         


        
相关标签:
1条回答
  • 2020-12-04 03:53

    The FXMLLoader appends Controller to the fx:id specified in the fx:include element to get the name of the field to inject the controller to. Therefore it should be either:

    @FXML
    private SelectedIssueController selectedIssueControllerController;
    

    or

    <fx:include fx:id="selectedIssue" source="controllers/selectedissue.fxml" />
    

    The value injected to the field without the Controller suffix is the value created for the fx:include, i.e. the Object created for the root of the included fxml.

    0 讨论(0)
提交回复
热议问题