Image won't display in JLabel

后端 未结 5 638
轻奢々
轻奢々 2021-01-21 03:17

I\'ve gone through every post I could find on this site and the Java tutorials and I still can\'t figure out why my code isn\'t working. Even when I copy/paste other peoples\'

5条回答
  •  隐瞒了意图╮
    2021-01-21 03:48

    You might need to debug it and check if the image file is loaded correctly. And then you need to check if the JLabel Component gets its size because adding the image to the JLabel wouldn't expand the JLabel.

    First you should try to see the image handler has its width and height.

提交回复
热议问题