Remove JTextPane's white background without setOpaque() over a translucent JFrame

前端 未结 2 783
遇见更好的自我
遇见更好的自我 2021-01-24 20:40

I have a Java code where I implemented a translucent JPanel with an image drawn on it with Graphics 2D. This image is a PNG that includes a white rectangle, 80% opaque, all over

2条回答
  •  花落未央
    2021-01-24 21:22

    to make it work with Nimbus L&F:

    jta.setOpaque(false);
    jta.setBorder(BorderFactory.createEmptyBorder());
    jta.setBackground(new Color(0,0,0,0));
    

提交回复
热议问题