简体   繁体   English

在Java NetBeans IDE中的jframe中设置背景图像的函数

[英]function to set background image in a jframe in java netbeans ide

I am making a java application using netbeans ide 6.8. 我正在使用netbeans ide 6.8制作Java应用程序。 I don't the function to set a background image to my jframe. 我没有为jframe设置背景图像的功能。 I will be very helpful if you can post the specific coding. 如果您可以发布特定的编码,我将非常有帮助。

There is not function to do this. 没有执行此操作的功能。 You need custom code. 您需要自定义代码。 Background Panel has a couple of suggestions depending on your requirements. 背景面板会根据您的要求提供一些建议。

There isn't a function to do that, you have to set a JLabel with your icon property set to the picture and set it to the length and width of the JFrame and set the JFrame's layout property value to null. 没有执行此操作的功能,您必须将JLabel的icon属性设置为图片,并将其设置为JFrame的长度和宽度,并将JFrame的layout属性值设置为null。 Then just change the order of the buttons/Labels and what have you so that the background is in fact, in the back. 然后只需更改按钮/标签的顺序以及您所拥有的内容,以使背景实际上位于背面。 For a more detailed solution to the particular problem, go to http://www.netbeanstutorials.com/p/setting-background-image.html There's even a video how to do it there. 有关特定问题的更详细解决方案,请访问http://www.netbeanstutorials.com/p/setting-background-image.html甚至那里有一个视频,介绍了如何执行此操作。 I know I was specific but to a newbie it can be overwhelming. 我知道我很具体,但是对于一个新手来说,它可能是压倒性的。

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

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