JavaFX 2.0 loading fxml files with event handlers fails

↘锁芯ラ 提交于 2019-12-01 23:38:41

If you are defining an action of Button in FXML file like this:

 <Button text="Login" onAction="#processLogin"/>

then you must define a method in the controller class like as following. Note the signature of processLogin:

    @FXML
    private void processLogin(javafx.event.ActionEvent event) {
        // Process Login
    }
标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!