In my interface I have one JPanel with null layout as a background label holder, with no other components. I'm trying to add a row of images on top of that background as a GridLayout. I have made sure that the Icons work properly when added to a JLabel but when I try to add the Grid Panel to the background panel, it doesn't show the images. This is my code so far:
jPanel1 = new javax.swing.JPanel();
backgroundLabel = new javax.swing.JLabel();
backgroundLabel.setIcon(new javax.swing.ImageIcon(getClass().getResource("/Ile/Background.jpg")));
jPanel1.add(backgroundLabel);
That is the background, then I try to add the Grid of images on top of that:
JPanel gridPanel = new JPanel(new GridLayout(9,3));
JLabel ashes = new JLabel();
ImageIcon ashesIcon = new ImageIcon(getClass().getClassLoader().getResource("Resources/Ashes.png"));
ashes.setIcon(ashesIcon);
gridPanel.add(ashes);
jPanel1.add(gridPanel);
jPanel2.setVisible(true);
But nothing is being displayed at all, any advice?