Java8的::允许仅通过方法名称引用方法。protectedObjectloadBeanController(Stringurl)throwsIOException{loader=newFXMLLoader(getClass().getResource(url));ApplicationContextcontext=MyProjectClass.getApplicationContext();loader.setControllerFactory(context::getBean);returnloader.getController();}但是,根据BeanFactoryInter
Java8的::允许仅通过方法名称引用方法。protectedObjectloadBeanController(Stringurl)throwsIOException{loader=newFXMLLoader(getClass().getResource(url));ApplicationContextcontext=MyProjectClass.getApplicationContext();loader.setControllerFactory(context::getBean);returnloader.getController();}但是,根据BeanFactoryInter