JLabel imagine_hearth = new JLabel(new ImageIcon( new ImgUtils().scaleImage(35,35,"health.png")));
JLabel imagine_bullet = new JLabel(new ImageIcon( new ImgUtils().scaleImage(35,35,"bullet.jpg")));
JLabel player_icon = new JLabel();
Board2 b2 = new Board2();
JPanel stats = new JPanel();
stats.setSize(100,450);
stats.setLayout(new GridLayout(12,2));
for(i=1; i<5 ; i++)
{
stats.add(new JLabel("Player " + i));
player_icon.setIcon(new ImageIcon( new ImgUtils().scaleImage(35,35,pioni[i-1])));
stats.add(player_icon,BorderLayout.CENTER);
stats.add(new JLabel("X" + pl[i-1].nr_lives));
stats.add(imagine_hearth,BorderLayout.CENTER);
stats.add(new JLabel("X" + pl[i-1].nr_bullets));
stats.add(imagine_bullet,BorderLayout.CENTER);
}
this is how it looks I just started coding in java and I encountered a problem with an JLabel Grid Layout. As you can see in the code above i tried to make a matrix 12X2 with text and pictures but the program only load the pictures for the final entry and I have no idea why. I tried several options like GridBagLayout without any succes. Thanks in advance for the help.