javafx - Java method does not override -


i trying display image fetch database in table view. here how set table view image column:

tablecolumn prodimagecol = new tablecolumn("images");     prodimagecol.setcellvaluefactory(new propertyvaluefactory<product, image>("prodimage"));     prodimagecol.setminwidth(100);     // setting cell factory product image             prodimagecol.setcellfactory(new callback<tablecolumn<product, image>, tablecell<product, image>>() {         @override         public tablecell<product, image> call(tablecolumn<product, image> param) {             tablecell<product, image> cell = new tablecell<product, image>() {                 @override //error here                 public void updateitem(product item, boolean empty) {                     if (item != null) {                         imageview imageview = new imageview();                         imageview.setfitheight(50);                         imageview.setfitwidth(50);                         imageview.setimage((image) item.getprodimage());                         setgraphic(imageview);                     }                 }             };             return cell;         }     }); 

however, getting method not override or implement method supertype. have no idea why because follow same thing website on how display image in table view. can please explain me why so? in advance.

update: signature of updateitem method is:

@override protected void updateitem(image image, boolean b) {     super.updateitem(image, b); } 

i posted original answer (before got same compile error did).

you can have method if like:

public void updateitem(product item, boolean empty); 

you can't annotate with:

    @override 

which means redefining method exact same signature (name , arguments) base class.

alternatively, reverse generic type arguments:

<image, product> vs. <product, image> 

Comments

Popular posts from this blog

php - Calling a template part from a post -

Firefox SVG shape not printing when it has stroke -

How to mention the localhost in android -