I need to click on the Image that is already in a column to automatically call a method. But I don't seem capable of doing it. I've got a class named worker, the tableview is set with an ObservableList of Worker objects that i obtain from a database.
Here's an image of mi table:
The images are an attribute of Worker class if anyone is wondering. They are for deleting and editing the rows.
Here's the code that I use to fill the tableview;
@Override
public void initialize(URL url, ResourceBundle rb) {
DatabaseController dbc;
dbc = new DatabaseController();
dbc.connect();
ObservableList<Empleado> empleados = dbc.selectEmpleados();
columNombre.setCellValueFactory(new PropertyValueFactory<>("nombre"));
columActivo.setCellValueFactory(new PropertyValueFactory<>("activo"));
columApellidos.setCellValueFactory(new PropertyValueFactory<>("apellidos"));
columDNI.setCellValueFactory(new PropertyValueFactory<>("dni"));
columRango.setCellValueFactory(new PropertyValueFactory<>("rango"));
columTelefono.setCellValueFactory(new PropertyValueFactory<>("telefono"));
columEmail.setCellValueFactory(new PropertyValueFactory<>("email"));
columID.setCellValueFactory(new PropertyValueFactory<>("id"));
columRol.setCellValueFactory(new PropertyValueFactory<>("rol"));
columEdit.setCellValueFactory(new PropertyValueFactory<>("edit"));
columDelete.setCellValueFactory(new PropertyValueFactory<>("delete"));
table_empleados.setItems(empleados);
}