Back to course

Controllers and FXID

JavaFX 0 to Hero

Controllers and FXID

To bridge FXML and Java code, we use:

  • fx:id: An identifier for a component in FXML.
  • Controller Class: A Java class that manages the FXML file.

Use the @FXML annotation in Java to link variables to FXML elements.