Question

I want to call my method in fxml file after user click on text field, but see exception:

Exception in thread "JavaFX Application Thread" java.lang.IllegalArgumentException: argument type mismatch

My fxml tag:

<TextField fx:id="userId"  onMouseClicked="#processEnter" />

What can I do?

Was it helpful?

Solution

Make sure the parameter type for processEnter(...) is MouseEvent, and that you have the correct import in the controller: javafx.scene.input.MouseEvent, not the awt version.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top