JavaFX Utils

Window

Component to help deal with windows.

Window class is generic in <T extends Parent, A> where A is the generic type of IInitializable<A>. If Controller class doesn't implement IInitializable this type should be Void.

During the mounting process if is used FXMLFile and this throws ComponentException this Exception will be spread.

Constructors

public Window(T root, String windowTitle)

  • root : root Parent of window.
  • windowTitle : title of Window.

There are more constructors with different parameters, but all will internally call this first one.

Variations :

  • Constructors that receive IComponent<T> component will obtain Parent from component.getNode().
  • Constructors that don't receive String windowTitle this value is assumed as empty String.
  • Constructors that don't receive arguments as String fXMLFilePath and A initializableArgument will use them to instantitate FXMLFile
public Window(T root)
public Window(IComponent<T> component, String windowTitle)
public Window(IComponent<T> component)
public Window(String fXMLFilePath, A initializableArgument, String windowTitle)
public Window(String fXMLFilePath, A initializableArgument)
public Window(String fXMLFilePath, String windowTitle)
public Window(String fXMLFilePath)

Usage

	try {
		new Window<AnchorPane, Void>("path").open();
	} catch (ComponentException e) {
		//Treat Exception
	}
					

Links