Skip to Main Content

Java SE (Java Platform, Standard Edition)

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Display Image in TableCell

1010912Sep 19 2013 — edited Sep 19 2013

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 !!

Comments

TonyScalese
The question of how to execute a calc script has been asked a number of times on this forum. I would suggest you do a search of the forums as a starting point.
851939
Sorry, but I have searched in this forum.
I have found topics about how to execute calc script after the load, but nothing (at least I have not found) about calc script befort many load via batch loader.

So if someone can give me some clues...

thanks!

Fanny
1 - 2
Locked Post
New comments cannot be posted to this locked post.

Post Details

Locked on Oct 17 2013
Added on Sep 19 2013
1 comment
340 views