I got a problem showing an image using the imageview from javafx ...
First is I load the stored image(Blob) from mySql then pass it to my Model class as ByteArrayInputStream.
At First when you click the 'Info' Button at the first time it will Open the 'INFO' class and showing you the image, but when you close it and reOpen it then the image suddenly disappear or not showing anything.
Opening it at First Time
中发送链接你可以看到图像,但是......
如果您再次重新开课
它不会显示任何内容或图像无法加载
以下是代码:
public void setPerson(Person person){
this.person = person;
ByteArrayInputStream in = person.getImage();
if(in != null){
iv_image.setImage(new Image(person.getImage()));
}else{
iv_image.setImage(null);
}
lbl_id.setText("" + person.getId());
lbl_date.setText(person.getDate());
lbl_fname.setText(person.getFname());
}