How to draw images on transparent window?

后端 未结 2 1637
名媛妹妹
名媛妹妹 2020-12-11 10:10

I\'m trying to draw Images with Graphics2D on JFrame.
But this code only displays blank background.
How to do that?

Java Version: SE-1.6
IDE: Ecl

2条回答
  •  遥遥无期
    2020-12-11 10:50

    Another way can be seen here. It can be accomplished by

    frame.setBackground(new Color(0, 0, 0, 0));
    ....
    setOpaque(false);  //for the JPanel being painted on.
    

    enter image description here

提交回复
热议问题