72.1k views
1 vote
In a JavaFX FXML app, you define the app's event handlers in a________class, which defines instance variables for interacting with controls programmatically, as well as event-handling methods.

a. view
b. model
c. controller
d. data

User Catskul
by
8.5k points

1 Answer

5 votes

Final answer:

In a JavaFX FXML app, event handlers are defined in a 'controller' class, which has instance variables linked to FXML components and methods to handle events.

Step-by-step explanation:

In a JavaFX FXML application, the app's event handlers are defined in a controller class. This class is responsible for managing the user interaction with the GUI. It binds the application's logic to the views laid out in the FXML files. The controller defines instance variables which are typically annotated with FXML, allowing these variables to be linked to the FXML components. The methods in the controller class handle events such as button clicks and provide the functionality to interact with other components programmatically. So, to answer the question, the event handlers in a JavaFX FXML app are defined in a 'controller' class.