Synth - 设置 JFrame 背景
我正在使用 Swing 和 Synth 在 Java 中创建一个应用程序。我想使用 Synth 将图像背景设置为 JFrame。怎么做呢?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
我正在使用 Swing 和 Synth 在 Java 中创建一个应用程序。我想使用 Synth 将图像背景设置为 JFrame。怎么做呢?
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
接受
或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
发布评论
评论(2)
JFrame 尚未实现 Color,您可以这样做
1) JFrame#getContentpane。setBackground(颜色 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))
没有更好的解决方案,所以我决定使用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).