codetoad.com
  ASP Shopping CartForum & BBS
  - all for $20 from CodeToad Plus!
  
  Home || ASP | ASP.Net | C++/C# | DHTML | HTML | Java | Javascript | Perl | VB | XML || CodeToad Plus! || Forums || RAM 
Search Site:
Search Forums:
  Cant include picture in JButton  IanVanBirckoff at 17:46 on Friday, April 29, 2005
 

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