Transparent JFrame background

后端 未结 5 878
温柔的废话
温柔的废话 2021-02-15 16:31

Is it possible to make a JFrame that has a transparent background and draw an image on it, so only the image will be visible with no border or background?

5条回答
  •  死守一世寂寞
    2021-02-15 16:57

    It is possible.

    If your JFrame is a local variable or field:

    myJFrame.setUndecorated(true);
    

    If your class extends JFrame:

    setUndecorated(true);
    

提交回复
热议问题