|
I wish to show a picture from this line instead of a yellow background !
if(plateau[j] == 0) terrainDeJeu.getComponent(i*7+j).setBackground(Color.yellow);
HOW DO I PROCEED?
public Container createContentPane()
{
plateau = new int[6][7];
for(int i=0; i<6; i++)
for(int j=0; j<7; j++)
{
plateau[j] = 0;
}
joueur = 1;
fin = false;
initComposants();
for ( int i=0 ; i<42 ; i++ )
{
JButton paneTmp = new JButton(iconJeu);
paneTmp.setEnabled(true);
paneTmp.setBackground(Color.orange);
terrainDeJeu.add(paneTmp);
}
return terrain;
}
|
|
<Added>
private int plateau[][];
private JPanel terrainDeJeu;
private JPanel terrain;
|
|
|
|
|
|
|
© Copyright codetoad.com 2001-2005 |
|
|