Pergunta

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?

Foi útil?

Solução

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.

Licenciado em: CC-BY-SA com atribuição
Não afiliado a StackOverflow
scroll top