简体   繁体   English

如何让JPanel透明?

[英]How do i make a JPanel Transparent?

I tried using setOpaque(false); 我尝试使用setOpaque(false); but it just makes the background of the JPanel white.. How do i make it not draw the panel at all?. 但它只是让JPanel的背景变白了。我如何让它完全没有绘制面板?

You answered the question yourself. 你自己回答了这个问题。

The JPanel didn't become white, but it showed -- because it became non-opaque -- the JFrame (or other controls) behind it. JPanel并没有变成白色,但它显示 - 因为它变得不透明 - 它背后的JFrame(或其他控件)。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM