Display image in table

前端 未结 2 2095
说谎
说谎 2020-12-12 03:22

I am trying to insert an image into table view in JavafX. Here is how I set up my table view:

TableColumn prodImageCol = new TableColumn(\"IMAGES\");
    pro         


        
2条回答
  •  生来不讨喜
    2020-12-12 03:46

    1. why are not creating the Image directly from the data new Image(new ByteArrayInputStream(data)) no need to rewrap it our use Swing stuff
    2. I don't see a public Image(Object) constructor in FX8 - why passing it anyways if you are already have an image instance?
    3. you need to set the ImageView on the cell with setGraphic()

提交回复
热议问题