且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

找不到JavaFX控制器方法

更新时间:2021-12-02 22:37:37

此外,当我尝试这样做时,它还会向我发出警告:参数'event' 无法分配给javafx.event.Event"

Also, when I try to do so, it gives me a warning: "Parameter 'event' is not assignable to javafx.event.Event"

所以,这是您的问题.您的Controller导入错误:您拥有java.awt.event.ActionEvent而不是JavaFX ActionEvent.

So, there's your problem. You have the wrong import in your Controller: you have the java.awt.event.ActionEvent instead of the JavaFX ActionEvent.