So, basically, I have created my picture using this:
private static JPanel testpic = new JPanel() { ImageIcon backImage = new ImageIcon("src/bc.jpg"); Image image = backImage.getImage(); {setOpaque(false);} //Override public void paintComponent (Graphics g) { g.drawImage(image, 0, 0, this); super.paintComponent(g); } };
As you can see I named my panel "testpic". I later on added testpic to my frame, and before that added a label to my testpic. The label shows up fine, and its background is set to my picture. The only problem is that my picture ONLY takes up the space of my label. Instead of expanding and filling up the whole panel like a background should do, it is more like a tiny background for my label. Can anyone tell me how to fix this? Thanks in advance!