The lab includes this line of code:
btnD4.setOnMouseClicked(evt -> rollDie(4))
OnMouseClicked is an event, and we want to associate a "handler" for it -- i.e. some code that runs whenever the mouse gets clicked within the btnD4 UI widget.
To understand this deeper, Java is technically passing in a new object of a class that implements the EventHandler interface, and includes a method that looks like this:
btnD4.setOnMouseClicked(new EventHandler<MouseEvent>() {
@Override
public void handle(MouseEvent evt) {
rollDie(4);
}
});
However, this all gets hidden within the arrow "lambda expression"
(evt -> rollDie(4))