是否可以在 Swing 上设置 TitledBorder 不透明?

发布于 2024-07-11 19:25:19 字数 50 浏览 4 评论 0原文

在 Swing 上是否可以将 TitledBorder 设置为透明,以便背景图像透过?

Is it somehow possible on Swing to set a TitledBorder transparent so that a background image shines through?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

孤寂小茶 2024-07-18 19:25:19

找到了答案。

方法。

setOpaque(false) 

使用底层面板上的

Found the answer.

Use the method

setOpaque(false) 

on the underlying panel.

始于初秋 2024-07-18 19:25:19

奇怪 - TitledBorder。 isBorderOpaque() 应该返回 false,所以它应该已经可以工作了。 也许问题只是您要放置边框的组件没有在边框插图上绘制背景图像?

Strange - TitledBorder.isBorderOpaque() supposedly returns false, so it should already work. Maybe the problem is just that the component you're putting the border on just doesn't paint the background image over the border insets?

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文