// -------------------------------------------------- // GEREIMAGE : COMMUNICATION ENTRE APPLETS // -------------------------------------------------- import java.applet.*; import java.awt.*; public class GereImage extends Applet { // Initialisation de l'applet public void init() { setBackground(Color.black); } // Affichage public void paint(Graphics g) { g.setColor(Color.white); g.drawString("Survolez l'applet à la souris...", 10, 15); } // La souris entre dans l'applet public boolean mouseEnter(Event e, int x, int y) { AfficheImage ai; ai = (AfficheImage)getAppletContext().getApplet("AFFIM"); if (ai != null) { ai.afficher = true; ai.repaint(); } return true; } // La souris sort de l'applet public boolean mouseExit(Event e, int x, int y) { AfficheImage ai; ai = (AfficheImage)getAppletContext().getApplet("AFFIM"); if (ai != null) { ai.afficher = false; ai.repaint(); } return true; } }