Make a JPanel not draw its background (Transparent)

后端 未结 5 1199
孤城傲影
孤城傲影 2020-12-05 17:50

Is it possible, in Java, to make a JPanel skip drawing its background thus being transparent except for the components on it?

5条回答
  •  眼角桃花
    2020-12-05 18:27

    If you are using NetBeans, Then Do these steps:-

    1. Right Click on JPanel.
    2. Scroll Down and Search For (( Opaque )). It must be there.
    3. Uncheck it.
    4. Now your JPanel background will be removed and what will appear in JPanel Background is your Background of JFrame.

提交回复
热议问题