Synth - 设置 JFrame 背景

发布于 2024-12-27 07:59:00 字数 93 浏览 6 评论 0 原文

我正在使用 Swing 和 Synth 在 Java 中创建一个应用程序。我想使用 Synth 将图像背景设置为 JFrame。怎么做呢?

I'm creating an app in Java using Swing and Synth. I want to set image background to JFrame using Synth. How to do it?

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

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

发布评论

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

评论(2

烟柳画桥 2025-01-03 07:59:00

JFrame 尚未实现 Color,您可以这样做

1) JFrame#getContentpanesetBackground(颜色 c)

更好的是

2) JFrame#add(JPanel#setBackground(Color c))

JFrame haven't implemented Color, you can do that

1) JFrame#getContentpane.setBackground(Color c)

better would be

2) JFrame#add(JPanel#setBackground(Color c))

稀香 2025-01-03 07:59:00

没有更好的解决方案,所以我决定使用Java2D直接在JFrame上绘制背景(尽管我现在没有代码)。

There weren't better solution, so I decided to draw the background directly on the JFrame using Java2D (although I don't have the code now).

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