I want to set a image background on my JFrame thanks to automated generated code by Netbeans.
Unfortunately, I am facing this exact problem : http://www.areaofthoughts.com/2011/08/netbeans-jframe-properties-iconimage.html
When I tried to add it graphically, on details of iconImage, I have this error : "Custom editing of this property is not supported"
I tried the solution given in the link above, but unfortunately, this code doesn't work:
public ArrayList<Image> getIconImages() {
ArrayList<Image> imageList = new ArrayList();
imageList.add(getClass().getResource("/<resource_path>" +
"/image.png")).getImage());
return imageList;
}
What is the problem in this code, and how can I fix this problem of background (by any way?).
Please note that when I did it for label with Netbeans, I had no problem for doing it. The generated code was, for example, the following:
jButton1.setIcon(new javax.swing.ImageIcon(getClass().getResource("/main/myimage/img.png")));