Salve a tutti, ho un problema con il GridLayout che dovrebbe aggiungermi ImageCode in orizzontale invece me li aggiunge in verticale, vi posto il pezzo di codice:
codice:
contenitoreCGPS.setLayout(new GridLayout(10,numPosti));
contenitoreCGPG.setLayout(new GridLayout(10,numPosti));
for(int i=(tentativo*numPosti);i<(tentativo+1)*numPosti;i++)
{
if( scelte[i].getIcon().toString().equals(segreto[i % numPosti]))
{
contenitoreCGPG.add(new JLabel ("", new ImageIcon ("src/RedB.png"), SwingConstants.CENTER));
}
else
{
if (insieme.contains(scelte[i].getIcon().toString()))
{
contenitoreCGPS.add(new JLabel ("", new ImageIcon ("src/WhiteB.png"), SwingConstants.CENTER));
}
}
}