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;








CodeToad Experts

Can't find the answer?
Our Site experts are answering questions for free in the CodeToad forums








Recent Forum Threads
•  cant view jsp
•  Cant include picture in JButton
•  View State management in User custom control
•  MSMQ with workgroup environment
•  access connection to JSP
•  Please help this n00bie to make a tabbed table work in Netscape 6+
•  ASP / Frames
•  Re: email with image
•  Re: Windows Authentication using LDAP get user first name


Recent Articles
Communicating with the Database (Using ADO)
MagicGrid
Simple Thumbnail Browsing Solution
Type Anywhere
A Better Moustrap: FmtDate to replace FormatDateTime
ASP.NET Forum Source Code
Internal Search Engine
Javascript Growing Window
Simple date validation
Search engine friendly URLs using ASP.NET (C#.NET)


Site Survey
Help us serve you better. Take a five minute survey. Click here!

© Copyright codetoad.com 2001-2005