将此代码放在FXMLExampleMVC.java中
private static FXMLExampleMVC instance;
public FXMLExampleMVC() {
instance = this;
}
// static method to get instance of view
public static FXMLExampleMVC getInstance() {
return instance;
}
@FXML protected void handleSubmitButtonRegister() throws IOException{
//
//Here I want to invoke gotoRegister
FXMLExampleMVC.getInstance().gotoRegister();
}