How to place a Mousecliked event on a table using Javafx

Asked

Viewed 265 times

2

I’m trying to put a Mousecliked event on my table but gives this error:

java.lang.IllegalArgumentException: argument type mismatch

My method is like this:

private void tblArquivosMouseCliked(ActionEvent event) {

        System.out.println("Click Detectado");

    }

And in Scene Builder:

inserir a descrição da imagem aqui

Can anyone help? Thank you.

1 answer

1


Your method should be as follows:

@FXML
public void tblArquivosMouseCliked(MouseEvent event) {
    System.out.println("Click Detectado");
}
  • Now you’re making this mistake: javafx.fxml.LoadException: Error resolving onMouseClicked='#tblArquivosMouseCliked', either the event handler is not in the Namespace or there is an error in the script.

  • 1

    @Techies sorry, I had not realized that the method was private I had only noticed the Actionevent, corrected. By the way, I intend to give a more complete answer soon, but for now is what I can answer :)

  • Thank you very much, ok I’ll be waiting :D

Browser other questions tagged

You are not signed in. Login or sign up in order to post.