transparent parts of GIF/PNG image shown in black inside a JLabel java
问题 I have an image (gif or png) with some transparents parts which appear in black when put inside a JLabel. ClassLoader cl = this.getClass().getClassLoader(); ImageIcon img = new ImageIcon(cl.getResource("resources/myPicture.png")); label = new JLabel(img); How do I work around this problem ? I do not need the JLabel, maybe there is a better way to display the image correctly (i.e. with the transparency) directly on a JPanel ? Thanks David 回答1: Found the culprit ! Actually the picture is