Quand je lance l'applet photo dans une page HTML , il m'affiche bien l'image.
Mais quand je lance l'applet essai, il m'affiche le fond jaune mais pas la photo.
Quelqu'un peut il me donner une explication ?
Thanks !!!
public class essai extends Applet {
public JFrame fenetre;
public void init()
{
JFrame fenetre = new JFrame();
fenetre.setSize(300, 300);
photo app = new photo();
fenetre.getContentPane().add(app);
app.start();
app.setVisible(true);
...
}
}
public class photo extends Applet
{
public Image img;
public void init()
{
img=getImage(getCodeBase(),"./balcon2.gif" );
}
public void paint(Graphics g)
{
setBackground(Color.YELLOW);
g.drawImage(img,0,0,200,200,this);
}
}