1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59
|
public void identifierContenuCase(int i,int j){
URL male = getClass().getResource("/evolution/garcon.gif");
URL femelle = getClass().getResource("/evolution/fille.gif");
ImageIcon pmale = new ImageIcon(male);
ImageIcon pfemelle = new ImageIcon(femelle);
JLabel lmale = new JLabel(pmale);
JLabel lfemelle = new JLabel(pfemelle);
String t="";
p=new JPanel();
p.setSize(new Dimension(screenHeight,screenHeight));
l=new JLabel();
boolean pastexte=false;
if(RIEN){
t=" "+". ";
p.setBackground(gris);
}
else
{
if(NOURRITURE)
{
t=" "+grille.grille[i][j].nourriture.getNourriture();
p.setBackground(jaune);
}
else
{
pastexte=true;
if(MALE)
{
l=lmale;
//p.setToolTipText(grille.afficherCaractAmibe(grille.grille[i][j].a));
}
if(FEMELLE)
{
//p.setToolTipText(grille.afficherCaractAmibe(grille.grille[i][j].a));
l=lfemelle;
}
}
}
if(!pastexte){
l.setText(t);
l.setFont(f);
}
p.setBorder(BorderFactory.createLineBorder(blanc));
panelGrille.add(p);
p.add(l);
p.setVisible(true);
} |
Partager