Hi,
This might be a problem seen before but I'm really trying to do this by the Book !!
edit.setCellFactory(new Callback<TableColumn<Object, ImageView>, TableCell<Object, ImageView>>() {
@Override
public TableCell<Object, ImageView> call(TableColumn<Object, ImageView> param) {
TableCell<Object, ImageView> cell = new TableCell<Object, ImageView>() {
@Override
public void updateItem(ImageView item, boolean empty) {
if (item != null) {
HBox box = new HBox();
box.setSpacing(10);
VBox vbox = new VBox();
ImageView imageview = new ImageView();
imageview.setFitHeight(50);
imageview.setFitWidth(50);
imageview.setImage(new Image(getClass().getResource("edit.png").toExternalForm()));
box.getChildren().addAll(imageview, vbox);
//SETTING ALL THE GRAPHICS COMPONENT FOR CELL
setGraphic(box);
}
}
};
return cell;
}
});
when running the program, everything seems to be ok but actually nothing shows up in the tableCell !!
For some reason, it seems that the declaration of the Callback classes is wrong !!
All I'm trying is to add an edit icon to the a column that has no data in it !!