//fxml
<cellValueFactory>
<PropertyValueFactory property="image" />
</cellValueFactory>
<cellFactory>
</cellFactory>
</TableColumn>
//controller
@FXML
private void handleButtonActionSearch
(ActionEvent event
) {
image.setCellFactory(new
Callback<TableColumn<BoardThread,BoardThread>,TableCell<BoardThread,BoardThread>>(){
@Override
public TableCell<BoardThread, BoardThread> call(TableColumn<BoardThread, BoardThread> p) {
TableCell<BoardThread, BoardThread> cell = new TableCell<BoardThread, BoardThread>(){
@Override
public void updateItem(BoardThread item, boolean empty) {
if(item!=null){
HBox box= new HBox();
box.setSpacing(10) ;
ImageView imageview = new ImageView();
imageview.setFitHeight(50);
imageview.setFitWidth(50);
imageview.
setImage(new Image("img/" + item.
getImage()));
box.getChildren().addAll(imageview);
//SETTING ALL THE GRAPHICS COMPONENT FOR CELL
setGraphic(box);
}
}
};
return cell;
}
});
//model
public class BoardThread {
private final SimpleStringProperty image = new SimpleStringProperty("");
public BoardThread() {
this("");
}
public BoardThread
(String image
) {
setImage(image);
}
/* setting images */
return image.get();
}
public void setImage
(String ffavoriteImage
) { this.image.set(ffavoriteImage);
}
}
Ly9meG1sCgogPFRhYmxlQ29sdW1uIHRleHQ9IkltYWdlIiAgcHJlZldpZHRoPSIxMDAiPgogICAgICAgICAgICAgICAgICAgICAgICA8Y2VsbFZhbHVlRmFjdG9yeT4KICAgICAgICAgICAgICAgICAgICAgICAgICAgIDxQcm9wZXJ0eVZhbHVlRmFjdG9yeSBwcm9wZXJ0eT0iaW1hZ2UiIC8+CiAgICAgICAgICAgICAgICAgICAgICAgIDwvY2VsbFZhbHVlRmFjdG9yeT4KICAgICAgICAgICAgICAgICAgICAgICAgICAgIDxjZWxsRmFjdG9yeT4KICAgICAgICAgICAgICAgICAgICAgICAgICAgIDwvY2VsbEZhY3Rvcnk+CiAgICAgICAgICAgICAgICAgICAgPC9UYWJsZUNvbHVtbj4KICAgICAgICAgICAgICAgICAgICAKLy9jb250cm9sbGVyCiBARlhNTAogICAgcHJpdmF0ZSB2b2lkIGhhbmRsZUJ1dHRvbkFjdGlvblNlYXJjaChBY3Rpb25FdmVudCBldmVudCkgewogICAgCiAgICBpbWFnZS5zZXRDZWxsRmFjdG9yeShuZXcgCiAgICAgICAgQ2FsbGJhY2s8VGFibGVDb2x1bW48Qm9hcmRUaHJlYWQsQm9hcmRUaHJlYWQ+LFRhYmxlQ2VsbDxCb2FyZFRocmVhZCxCb2FyZFRocmVhZD4+KCl7IAoKICAgICAgICBAT3ZlcnJpZGUKICAgICAgICBwdWJsaWMgVGFibGVDZWxsPEJvYXJkVGhyZWFkLCBCb2FyZFRocmVhZD4gY2FsbChUYWJsZUNvbHVtbjxCb2FyZFRocmVhZCwgQm9hcmRUaHJlYWQ+IHApIHsKICAgICAgICAgICAgCiAgICAgICAgICAgIFRhYmxlQ2VsbDxCb2FyZFRocmVhZCwgQm9hcmRUaHJlYWQ+IGNlbGwgPSBuZXcgVGFibGVDZWxsPEJvYXJkVGhyZWFkLCBCb2FyZFRocmVhZD4oKXsKICAgICAgICAgICAgCiAgICAgICAgICAgIEBPdmVycmlkZQogICAgICAgICAgICBwdWJsaWMgdm9pZCB1cGRhdGVJdGVtKEJvYXJkVGhyZWFkIGl0ZW0sIGJvb2xlYW4gZW1wdHkpIHsgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgIGlmKGl0ZW0hPW51bGwpeyAgICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICBIQm94IGJveD0gbmV3IEhCb3goKTsKICAgICAgICAgICAgICAgICAgICBib3guc2V0U3BhY2luZygxMCkgOwogICAgICAgICAgICAgICAgICAgIEltYWdlVmlldyBpbWFnZXZpZXcgPSBuZXcgSW1hZ2VWaWV3KCk7CiAgICAgICAgICAgICAgICAgICAgaW1hZ2V2aWV3LnNldEZpdEhlaWdodCg1MCk7CiAgICAgICAgICAgICAgICAgICAgaW1hZ2V2aWV3LnNldEZpdFdpZHRoKDUwKTsKICAgICAgICAgICAgICAgICAgICBpbWFnZXZpZXcuc2V0SW1hZ2UobmV3IEltYWdlKCJpbWcvIiArIGl0ZW0uZ2V0SW1hZ2UoKSkpOyAKCiAgICAgICAgICAgICAgICAgICAgYm94LmdldENoaWxkcmVuKCkuYWRkQWxsKGltYWdldmlldyk7IAogICAgICAgICAgICAgICAgICAgIC8vU0VUVElORyBBTEwgVEhFIEdSQVBISUNTIENPTVBPTkVOVCBGT1IgQ0VMTAogICAgICAgICAgICAgICAgICAgIHNldEdyYXBoaWMoYm94KTsKICAgICAgICAgICAgICAgIH0KICAgICAgICAgICAgfQogICAgICAgICAgICB9OwoKICAgICAgICAgICAgcmV0dXJuIGNlbGw7CiAgICAgICAgfQp9KTsKLy9tb2RlbAoKcHVibGljIGNsYXNzIEJvYXJkVGhyZWFkIHsKICAgIAogICBwcml2YXRlIGZpbmFsIFNpbXBsZVN0cmluZ1Byb3BlcnR5IGltYWdlID0gbmV3IFNpbXBsZVN0cmluZ1Byb3BlcnR5KCIiKTsKICAgCiAgIApwdWJsaWMgQm9hcmRUaHJlYWQoKSB7CiAgICAgICAgdGhpcygiIik7CiAgICB9CiAKICAgIHB1YmxpYyBCb2FyZFRocmVhZChTdHJpbmcgaW1hZ2UpIHsKCiAgICAgICAgc2V0SW1hZ2UoaW1hZ2UpOwoKICAgIH0KCgogICAgLyogc2V0dGluZyBpbWFnZXMgKi8KICAgIAogICAgcHVibGljIFN0cmluZyBnZXRJbWFnZSgpIHsKICAgICAgICByZXR1cm4gaW1hZ2UuZ2V0KCk7CiAgICB9CgogICAgcHVibGljIHZvaWQgc2V0SW1hZ2UoU3RyaW5nIGZmYXZvcml0ZUltYWdlKSB7CiAgICAgICAgdGhpcy5pbWFnZS5zZXQoZmZhdm9yaXRlSW1hZ2UpOwogICAgfQogICAgICAKfQoKCg==
Main.java:3: error: class, interface, or enum expected
<TableColumn text="Image" prefWidth="100">
^
Main.java:13: error: class, interface, or enum expected
private void handleButtonActionSearch(ActionEvent event) {
^
Main.java:19: error: class, interface, or enum expected
public TableCell<BoardThread, BoardThread> call(TableColumn<BoardThread, BoardThread> p) {
^
Main.java:24: error: class, interface, or enum expected
public void updateItem(BoardThread item, boolean empty) {
^
Main.java:27: error: class, interface, or enum expected
box.setSpacing(10) ;
^
Main.java:28: error: class, interface, or enum expected
ImageView imageview = new ImageView();
^
Main.java:29: error: class, interface, or enum expected
imageview.setFitHeight(50);
^
Main.java:30: error: class, interface, or enum expected
imageview.setFitWidth(50);
^
Main.java:31: error: class, interface, or enum expected
imageview.setImage(new Image("img/" + item.getImage()));
^
Main.java:33: error: class, interface, or enum expected
box.getChildren().addAll(imageview);
^
Main.java:35: error: class, interface, or enum expected
setGraphic(box);
^
Main.java:36: error: class, interface, or enum expected
}
^
Main.java:40: error: class, interface, or enum expected
return cell;
^
Main.java:41: error: class, interface, or enum expected
}
^
14 errors