private FXMLLoader loadSynchronously ( final URL resource , final Optional < ResourceBundle > bundle ) throws IllegalStateException { final FXMLLoader loader = new FXMLLoader ( resource , bundle . orElse ( null ) ) ; loader . setControllerFactory ( this :: createControllerForType ) ; try { loader . load ( ) ; } catch ( final IOException | IllegalStateException e ) { throw new IllegalStateException ( "Cannot load " + getConventionalName ( ) , e ) ; } return loader ; }
Load synchronously .