I have an implementation being developed in JavaFx only I came across some situation that seem to be simple, when designating an Event the image on your OnMouseClicked from my FXML I get the following error:
java.lang.IllegalArgumentException: argument type mismatch
When doing a test I changed the Image by Button and applied to OnMouseClicked I also got the same return, but on top of what I did I changed the method call to OnAction on the button and then yes I got the Event execution. p>
To apply this situation should you make a different method call?
As ImageView does not have the OnAction option, how can I apply the Event to it?
Here is the code for my method below:
@FXML
public void GravarTransportadora(ActionEvent event){
char fisjurpessoa = 'J';
SimpleDateFormat formatador = new SimpleDateFormat("dd/MM/yyyy");
try {
// CNPJ e IE insert
pf.inserir(txRazaoSocial.getText(),
Long.parseLong(txCnpj.getText()),
Long.parseLong(txIe.getText()),
(new java.sql.Date(((java.util.Date) formatador.parse(txDataInauguracao.getText())).getTime())),
fisjurpessoa,
txNomeFantasia.getText(),
txSite.getText());
} catch (Exception e) {
}
}