JavaFx Event argument type mismatch
Try using KeyEvent
instead of ActionEvent
@FXML
private void newButtonClick(KeyEvent event) { ...}
Use onAction="#newButtonClick"
, not onMouseClicked
.
If you want to use a mouseClicked
event, simply change your newButtonClicked
method to take in MouseEvent
@FXML
private void newButtonClick(MouseEvent event){...}