I'm making a Java Applet that has a null layout. I know everyone says this is bad, but in this case it is needed. I'm trying to add a background image to my applet, and I'm not too sure how to do it. I've seen lots of different ways but I don't really understand any; I'm new to programming.
This is what I tried...
JLabel background=new JLabel(new ImageIcon("Backgrounds\background.png"));
background.setBounds(0, 0, 850, 500);
add(background);
and nothing appeared. The image is called background.png
and is located in my project folder, within a folder called Backgrounds. Any ideas why this isn't working or how to get it working?