title: Display image in table
body: <p>I am trying to insert an image into table view in JavafX. Here is how I set up my table view:</p>
  
  <pre><code>TableColumn prodImageCol = new TableColumn("IMAGES");
      prodImageCol.setCellValueFactory(new PropertyValueFactory&lt;Product, Image&gt;("prodImage"));
      prodImageCol.setMinWidth(100);
      // setting cell factory for product image        
      prodImageCol.setCellFactory(new Callback&lt;TableColumn&lt;Product,Image&gt;,TableCell&lt;Product,Image&gt;&gt;(){        
          @Override
          public TableCell&lt;Product,Image&gt; call(TableColumn&lt;Product,Image&gt; param) {                
              TableCell&lt;Product,Image&gt; cell = new TableCell&lt;Product,Image&gt;(){
                      public void updateItem(Product item, boolean empty) {                        
                      if(item!=null){                            
                          ImageView imageview = new ImageView();
                          imageview.setFitHeight(50);
                          imageview.setFitWidth(50);
                          imageview.setImage(new Image(product.getImage()));
                      }
                  }
              };
              return cell;
          }
  
      });        
  
   viewProduct.setEditable(false);
   viewProduct.getColumns().addAll(prodImageCol, prodIDCol, prodNameCol, prodDescCol, prodPriceCol, col_action);
   viewProduct.getItems().setAll(product.populateProductTable(category));
  
   private SimpleObjectProperty prodImage;
  
   public void setprodImage(Image value) {
      prodImageProperty().set(value);
  }
  
  public Object getprodImage() {
      return prodImageProperty().get();
  }
  
  public SimpleObjectProperty prodImageProperty() {
      if (prodImage == null) {
          prodImage = new SimpleObjectProperty(this, "prodImage");
      }
      return prodImage;
  }
  </code></pre>
  
  <p>And this is how I retrieve the image from database:</p>
  
  <pre><code> Blob blob = rs.getBlob("productImage");
   byte[] data = blob.getBytes(1, (int) blob.length());
   bufferedImg = ImageIO.read(new ByteArrayInputStream(data));
   image = SwingFXUtils.toFXImage(bufferedImg, null);
  </code></pre>
  
  <p>However I am getting error at the setting up of table view: imageview.setImage(new Image(product.getImage()));
  The error message as:</p>
  
  <pre><code>no suitable constructor found for Image(Image)
  constructor Image.Image(String,InputStream,double,double,boolean,boolean,boolean) is not applicable
    (actual and formal argument lists differ in length)
  constructor Image.Image(int,int) is not applicable
    (actual and formal argument lists differ in length)
  constructor Image.Image(InputStream,double,double,boolean,boolean) is not applicable
    (actual and formal argument lists differ in length)
  constructor Image.Image(InputStream) is not applicable
    (actual argument Image cannot be converted to InputStream by method invocation conversion)
  constructor Image.Image(String,double,double,boolean,boolean,boolean) is not applicable
    (actual and formal argument lists differ in length)
  constructor Image.Image(String,double,double,boolean,boolean) is not applicab...
  </code></pre>
  
  <p>I did managed to retrieve and display an image inside an image view but however, I can't display it in table column. Any help would be appreciated. Thanks in advance.</p>