0
目前我正在JavaFX 2上开发GUI,并且我发现了很好的oracle示例:FXML-LoginDemo。在此示例中的场景2(FXML系),第一是AuthoriseForm,第二是的UserData变化的,主要类具有下一个方法:方法如何调用?
public boolean userLogging(String userId, String password){
if (Authenticator.validate(userId, password)) {
loggedUser = User.of(userId);
gotoProfile();
return true;
} else {
return false;
}
}
gotoProfile();
- 变化的场景..
的LoginController类具有下一个方法:
public void processLogin(ActionEvent event) {
if (application == null){
// We are running in isolated FXML, possibly in Scene Builder.
// NO-OP.
errorMessage.setText("Hello " + userId.getText());
} else {
if (!application.userLogging(userId.getText(), password.getText())){
errorMessage.setText("Username/Password is incorrect");
}
}
}
processLogin()
在代码中没有电话..所以,问题是:如何processLogin()
来电按下
太棒了!非常感谢! –