How can I show an image using the ImageView component in javafx and fxml?

前端 未结 7 1932
感情败类
感情败类 2020-12-03 14:21

I suppose it\'s a very simple thing but I just can\'t get behind it. All I want is to show an image over an ImageView linked to fxml. Here is my code:

packag         


        
相关标签:
7条回答
  • 2020-12-03 15:26

    The Code part :

    Image imProfile = new Image(getClass().getResourceAsStream("/img/profile128.png"));
    
    ImageView profileImage=new ImageView(imProfile);
    

    in a javafx maven:

    0 讨论(0)
提交回复
热议问题