将此代码放在FXMLExampleMVC.java中
private static FXMLExampleMVC instance;public FXMLExampleMVC() {instance = this;}// static method to get instance of viewpublic static FXMLExampleMVC getInstance() { return instance;}现在您可以像这样在控制器中调用视图方法
@FXML protected void handleSubmitButtonRegister() throws IOException{ // //Here I want to invoke gotoRegister FXMLExampleMVC.getInstance().gotoRegister(); }


