Class FxmlPane

All Implemented Interfaces:
Styleable, EventTarget

public abstract class FxmlPane extends StackPane
A StackPane capable of loading an FXML document.
  • Constructor Details

    • FxmlPane

      protected FxmlPane()
      Creates a new FxmlPane instance.
  • Method Details

    • getClassLoader

      protected final ClassLoader getClassLoader()
      Returns the class loader of this FxmlPane.
      Returns:
      a class loader or null if none defined.
    • setClassLoader

      protected final void setClassLoader(ClassLoader classLoader)
      Changes the class loader of this FxmlPane.
      Parameters:
      classLoader - the new class loader (can be null).
    • loadFxml

      protected final Parent loadFxml() throws IOException
      Loads the FXML document of this FxmlPane. The resource name of the FXML document is given by the simple name of this class plus the ".fxml" extension. The loaded FXML document is added to the list of children of this FxmlPane.
      Returns:
      a Parent containing the loaded FXML document.
      Throws:
      FileNotFoundException - if the FXML resource could not be found.
      IOException - if an I/O error occurs loading the FXML.
    • loadFxml

      protected final Parent loadFxml(String fxmlFile) throws IOException
      Loads the specified FXML document on this FxmlPane. The resource name of the FXML document is given by argument fxmlFile. The loaded FXML document is added to the list of children of this FxmlPane.
      Parameters:
      fxmlFile - the name of the FXML file to load on this FxmlPane.
      Returns:
      a Parent containing the loaded FXML document.
      Throws:
      NullPointerException - if fxmlFile is null.
      FileNotFoundException - if fxmlFile could not be found.
      IOException - if an I/O error occurs loading the FXML.
    • loadFxml

      protected final Parent loadFxml(URL fxmlURL) throws IOException
      Loads the specified FXML document on this FxmlPane. The resource URL of the FXML document is given by argument fxmlURL. The loaded FXML document is added to the list of children of this FxmlPane.
      Parameters:
      fxmlURL - the URL of the FXML file to load on this FxmlPane.
      Returns:
      a Parent containing the loaded FXML document.
      Throws:
      NullPointerException - if fxmlURL is null.
      IOException - if an I/O error occurs loading the FXML.