Annotation Interface Component


@Retention(RUNTIME) public @interface Component
Annotation for marking a controller which can be re-used in other controllers.

Classes annotated with @Component should extend from a Parent (e.g. Pane, HBox, VBox, ...). When rendering the component, the class itself will be used as the view (e.g. the HBox itself).

  • Optional Element Summary

    Optional Elements
    Modifier and Type
    Optional Element
    Description
    The view that should be rendered when displaying the component.
  • Element Details

    • view

      String view
      The view that should be rendered when displaying the component.

      If a view is specified, the fxml file will be loaded and the component will be used as the root of the view. Example: 'path/to/MyView.fxml' will load the FXML file MyView.fxml.

      Returns:
      The String specifying the view.
      Default:
      ""