Class FXMLLoaderUtil

java.lang.Object
com.serinity.accesscontrol.util.FXMLLoaderUtil

public final class FXMLLoaderUtil extends Object
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)
  • Method Details

    • loadScene

      public static javafx.scene.Scene loadScene(Class<?> caller, String fxmlPath)
      Loads an FXML file and wraps the root node in a new Scene.
      Parameters:
      caller - class used to resolve the FXML resource path
      fxmlPath - classpath path to the FXML file
      Returns:
      a new Scene containing the loaded FXML root
    • loadScene

      public static javafx.scene.Scene loadScene(Class<?> caller, String fxmlPath, ResourceBundle bundle)
      Loads an FXML file with a resource bundle and wraps the root in a Scene.
      Parameters:
      caller - class used to resolve the FXML resource path
      fxmlPath - classpath path to the FXML file
      bundle - resource bundle for i18n, or null
      Returns:
      a new Scene containing the loaded FXML root
    • loadFXML

      public static javafx.scene.Parent loadFXML(Class<?> caller, String fxmlPath)
      Loads an FXML file and returns the root Parent node.
      Parameters:
      caller - class used to resolve the FXML resource path
      fxmlPath - classpath path to the FXML file
      Returns:
      the root Parent node
    • loadFXML

      public static javafx.scene.Parent loadFXML(Class<?> caller, String fxmlPath, ResourceBundle bundle)
      Loads an FXML file with a resource bundle and returns the root node.
      Parameters:
      caller - class used to resolve the FXML resource path
      fxmlPath - classpath path to the FXML file
      bundle - resource bundle for i18n, or null
      Returns:
      the root Parent node
    • 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 a FXMLLoaderUtil.ViewLoader.
      Type Parameters:
      T - the controller type
      Parameters:
      caller - class used to resolve the FXML resource path
      fxmlPath - classpath path to the FXML file
      bundle - resource bundle for i18n, or null
      Returns:
      a FXMLLoaderUtil.ViewLoader containing the root node and controller