exemple d'applet Java pour donner un fond de couleur à une Applet

import java.applet.Applet;
import java.awt.*;

public class
fond1 extends Applet {    

    public void init() {
        setBackground(Color.
white);
    }
   
    public void paint(Graphics
g)    {
       
g.drawString("le fond est blanc",10,30);
    }
}

installes donc JAVA !

import java.applet.Applet;
import java.awt.*;

public class
fond2 extends Applet {     
      public void paint(Graphics
g)    {
                 Image
i; // image en fond
                 i = getImage(getCodeBase(),"
cetteimage.gif");
                 g.drawImage(i,0,0,this); // l'image à la taille réelle
          }
}
installes donc JAVA !
titre.gif (1044 octets)

dsdem.gif (1088 octets)