My previous SSCCE was incorrect itself. I tried to write one more, but it was incorrect too. So, for now I don't understand the problem and hence can't write pure Java example and therefore am posting example with library classes:
import javafx.scene.control.TableCell;
import javafx.scene.control.TableColumn;
import javafx.util.Callback;
public class DoubleQuestionMark3 {
public static class MyClass {
}
public static void main(String[] args) {
TableColumn<MyClass, ?> column = new TableColumn();
Callback<TableColumn<MyClass, ?>, TableCell<MyClass, ?>> callback = new Callback<TableColumn<MyClass, ?>, TableCell<MyClass, ?>>() {
@Override
public TableCell<MyClass, ?> call(TableColumn<MyClass, ?> param) {
return null;
}
};
column.setCellFactory(callback);
}
}
The question is same: how to prepare callback
of appropriate class?
If it is impossible, then, firstly, please state it is really impossible and secondly, please, explain WHY it is impossible.
UPDATE
Specifying Object
for callback doesn't help:
Callback<TableColumn<MyClass, Object>, TableCell<MyClass, Object>> callback = new Callback<TableColumn<MyClass, Object>, TableCell<MyClass, Object>>() {
@Override
public TableCell<MyClass, Object> call(TableColumn<MyClass, Object> param) {
return null;
}
};
>`as parameter, i.e. the same `S` and `T`. The wildcard doesn't fulfil that, it says it can be some "type"., TableCell`, i.e. `TableColumn, TableCell `. _But_ you are giving it a `TableColumn, TableCell`, where `?` can refer to some _other_ unknown type. This cannot work since you need to ensure that the _three of them_ refer to same type.