... the app loads the FXML file at runtime, you must specify the controller class’s name in the FXML file:

  1. Expand Scene Builder’s Controller window (located below the Hierarchy window).

  2. In the Controller Class field, type PainterController.

Step 12: Specifying the Event-Handler Method Names

Next, you’ll specify in the Inspector window’s Code section the names of the methods that will be called to handle specific control’s events:

  • For the drawingAreaPane, specify drawingAreaMouseDragged as the On Mouse Dragged event handler (located under the Mouse heading in the Code section). This method will draw a circle in the specified color and size for each mousedragged event.

  • For the four Drawing Color RadioButtons, specify colorRadioButtonSelected ...

Get Java How to Program, Early Objects, 11th Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.