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
| public void paint(Graphics g)
{
String s ;
BufferedImage i=null ;
File temp_file;
if ( show_result == false )
{
// 4 graines dans un trou au depart
s = "C:/Documents and Settings/Guillaume COLOMBAT/Bureau/Awalejava/tp2/images/seeds4.gif" ;
temp_file = new File(s);
try
{
i = ImageIO.read(temp_file);
}
catch(IOException e)
{
System.err.println(e);
}
}
else
{
s = "C:/Documents and Settings/Guillaume COLOMBAT/Bureau/Awalejava/tp2/images/result_move/seedsred" + nbseeds + ".gif" ;
temp_file = new File(s);
try
{
i = ImageIO.read(temp_file);
}
catch(IOException e)
{System.err.println(e);}
}
g.drawImage(i,0,0,this);
} |
Partager