我正在尝试在验证用户输入后启用禁用按钮。关于如何让它发挥作用的任何想法?
@FXML
public void validate(KeyEvent event) {
Register validate = new Register();
if(validate.authentication(usernameTxt.getText(), passwordTxt.getText(), repasswordTxt.getText())) {
next.setDisable(false); // <-- LINE 57
}
}
- 线程“JavaFX Application Thread”中的异常java.lang.RuntimeException:
java.lang.reflect.InvocationTargetException at javafx.fxml.FXMLLoader $ MethodHandler.invoke(FXMLLoader.java:1762)at at javafx.fxml.FXMLLoader $ ControllerMethodEventHandler.handle(FXMLLoader.java:1645) 引起:controller.RegisterController.validate(RegisterController.java:57)的java.lang.NullPointerException