Kotlin: JavaFX rowFactory for TableView
I'm trying to add a rowFactory to the table. In Java it works just fine:
tableView.setRowFactory(tv -> {
TableRow row = new TableRow();
row.setOnMouseClicked(event -> {
System.out.println(String.format("Mouse clicked: %s", event.toString()));
});
return row;
});
What I do wrong?
But in Kotlin it's not working:
tableView.rowFactory = Callback {
val row = TableRow()...