如何让JFrame透明化?我想让我的 JFrame 透明。当我的 JFrame 位于背景之上时,用户应该会看到背景。
最佳答案
我找到了另一个解决方案。
将框架的背景颜色设置为
// Set the frame background color to a transparent color
yourFrameHere.setBackground(new Color(0, 0, 0, 0));
并记住设置内容 Pane (您的 JPanel 或其他组件)的不透明度
// turn off opacity of the content pane
yourContentPaneHere.setOpaque(false);
关于java - 如何使JFrame透明?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/6660908/