Domanda

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?

È stato utile?

Soluzione

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.

Autorizzato sotto: CC-BY-SA insieme a attribuzione
Non affiliato a StackOverflow
scroll top