Starting off with JavaFX : Can not set javafx.scene.control.Label field application.SceneController.myLabel to javafx.scene.text.Text

后端 未结 1 1528
Happy的楠姐
Happy的楠姐 2021-01-19 17:31

I\'m starting off with JavaFX.

The error occurs when I execute my program, before I attempted to do this, it worked fine and button clicks worked, but that was befor

相关标签:
1条回答
  • 2021-01-19 18:30

    Inside your FXML, you have defined a Text, where as in your Controller, you are trying to use it as Label.

    The stackTrace (error) is shouting it on the top of its voice :

    Can not set javafx.scene.control.Label field application.SceneController.myLabel to javafx.scene.text.Text

    In your controller, you need to change the myLabel definition to

    @FXML
    private Text myLabel;
    
    0 讨论(0)
提交回复
热议问题