Class FXMLLoaderUtil
java.lang.Object
com.serinity.accesscontrol.util.FXMLLoaderUtil
Fxml loader util class
see `/fxml/*`
// Example usage
Scene scene = FXMLLoaderUtil.loadScene(this.getClass(), FXMLFile.SIGNIN.getFileName());
- Since:
- 2026-01-28 FXMLLoaderUtil.java
- Version:
- 1.0
- Author:
- @ZouariOmar (zouariomar20@gmail.com)
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic final classWrapper class that holds both the loaded FXML root node and its controller. -
Method Summary
Modifier and TypeMethodDescriptionstatic javafx.scene.ParentLoads an FXML file and returns the rootParentnode.static javafx.scene.ParentloadFXML(Class<?> caller, String fxmlPath, ResourceBundle bundle) Loads an FXML file with a resource bundle and returns the root node.static javafx.scene.SceneLoads an FXML file and wraps the root node in a newScene.static javafx.scene.SceneloadScene(Class<?> caller, String fxmlPath, ResourceBundle bundle) Loads an FXML file with a resource bundle and wraps the root in aScene.static <T> FXMLLoaderUtil.ViewLoader<T> loadView(Class<?> caller, String fxmlPath, ResourceBundle bundle) Loads an FXML file and returns both the root node and its typed controller wrapped in aFXMLLoaderUtil.ViewLoader.
-
Method Details
-
loadScene
-
loadScene
Loads an FXML file with a resource bundle and wraps the root in aScene.- Parameters:
caller- class used to resolve the FXML resource pathfxmlPath- classpath path to the FXML filebundle- resource bundle for i18n, ornull- Returns:
- a new
Scenecontaining the loaded FXML root
-
loadFXML
-
loadFXML
Loads an FXML file with a resource bundle and returns the root node.- Parameters:
caller- class used to resolve the FXML resource pathfxmlPath- classpath path to the FXML filebundle- resource bundle for i18n, ornull- Returns:
- the root
Parentnode
-
loadView
public static <T> FXMLLoaderUtil.ViewLoader<T> loadView(Class<?> caller, String fxmlPath, ResourceBundle bundle) Loads an FXML file and returns both the root node and its typed controller wrapped in aFXMLLoaderUtil.ViewLoader.- Type Parameters:
T- the controller type- Parameters:
caller- class used to resolve the FXML resource pathfxmlPath- classpath path to the FXML filebundle- resource bundle for i18n, ornull- Returns:
- a
FXMLLoaderUtil.ViewLoadercontaining the root node and controller
-