Echec chargement applet en java

Fermé
Deathwing Messages postés 97 Date d'inscription samedi 27 septembre 2008 Statut Membre Dernière intervention 19 mars 2010 - 21 janv. 2009 à 08:54
Deathwing Messages postés 97 Date d'inscription samedi 27 septembre 2008 Statut Membre Dernière intervention 19 mars 2010 - 23 janv. 2009 à 08:17
Bonjour,

Voila j'ai un petit souci d'affichage de mon diaporama sur mon site web. Lorsque je le testé sous easyphp, il c'est trés bien charger et il fonctionné. Maintenant que je l'ai mis en ligne, il ne veut plus se charger.
Il me met "Applet Diapo Notinited" et "echec du chargement de l'applet java"
Je suis pas un pro en java loin de la donc est-ce que quelqu'un aurait une idée.

Merci d'avance

EDIT : voila l'adresse du site en question : http://droit-narbonne.univ-perp.fr


Voila mon code html :


<APPLET code="Diapo.class" WIDTH="550" height="319" hspace="0" vspace="0" archive="diapo.zip">
<PARAM name=mainDelay value=5000>
<PARAM name=delay value=100>
<PARAM name=between value=0>
<PARAM name=message value="diaporama 3D fac de droit de narbonne">
<PARAM name=target value="_self">
<PARAM name=image1 value="images/diapo/fac1.jpg">
<PARAM name=image2 value="images/diapo/media.jpg">
<PARAM name=image3 value="images/diapo/narbonne5.jpg">
<PARAM name=image4 value="images/diapo/narbonne1.jpg">
<PARAM name=image5 value="images/diapo/narbonne2.jpg">
<PARAM name=image6 value="images/diapo/narbonne3.jpg">
<PARAM name=image7 value="images/diapo/narbonne4.jpg">
</APPLET>


et le code java :


import java.awt.*;
import java.awt.image.*;
import java.applet.*;
import java.net.URL;
import java.net.MalformedURLException;
import java.util.*;

/**
 * The diaporama applet class
 *
 * @version $Id: Diapo.java,v 1.38 1999/07/13 17:26:21 dfrick Exp $
 * @author Didier Frick (dfrick@dial.eunet.ch)
 */
public class Diapo extends java.applet.Applet {
    protected int between=5;
    protected int delay=100; /* ms */
    protected int mainDelay=2500;
    protected String message="diaporama 3D fac de droit de narbonne";
    protected String target="_blank";
    protected Image img;
    protected FadingImageSource src;
    protected Vector images;
    protected URL link;
    protected Thread thread;
    protected ThreadGroup threadGroup;


    /**
     * This flag is used to downgrade the behavior of this class if it is running in a
     * "problematic" environment like Netscape on the Macintosh.
     * If it is true, only the first image will be displayed
     */
    protected static boolean minimal=true;

    static {
	try {
	    String vendor=System.getProperty("java.vendor").toLowerCase();
	    String os=System.getProperty("os.name").toLowerCase();
	    minimal=vendor.startsWith("netscape")&&os.startsWith("mac");
	} catch(Exception xc) {
	    xc.printStackTrace();
	}
    }

    /**
     * Read the applet parameter values
     */
    public void init() {

	try {
	    between=Integer.parseInt(getParameter("between"));
	} catch (Exception x) {
	    ;
	}

	try {
	    mainDelay=Integer.parseInt(getParameter("mainDelay"));
	} catch (Exception x) {
	    ;
	}
    
	try {
	    delay=Integer.parseInt(getParameter("delay"));
	} catch (Exception x) {
	    ;
	}

	try {
	    link=new URL(getDocumentBase(),getParameter("link"));
	} catch (Exception x) {
	    ;
	}

	String param;
	param=getParameter("target");
	if(param!=null)
	    target=param;

	param=getParameter("message");
	if(param!=null)
	    message=param;

	images=new Vector();
	for(int nImages=0;(param=getParameter("image"+(nImages+1)))!=null; nImages++) {
	    try {
		Image i=getImage(getDocumentBase(),param);
		if(i!=null) {
		    images.addElement(i);
		    if(minimal)
			break;
		}
	    } catch (Exception x) {
		;
	    }
	}
	if(!minimal) {
	    threadGroup=Thread.currentThread().getThreadGroup();
	    src=new FadingImageSource(images,
				      between,
				      mainDelay,
				      delay,
				      bounds().width,
				      bounds().height);
	    img=createImage(src);
	} else {
	    img=(Image)images.elementAt(0);
	}
    }

    /**
     * Override update to suppress flashing
     */
    public void update(Graphics g) {
	paint(g);
    }

    /**
     * The paint method: draw the animated image if defined, otherwise
     * clear the background.
     */
    public void paint(Graphics g) {
	if(img!=null)
	    g.drawImage(img,0,0,this);
    }

    /**
     * The start method: create the ImageProducer and animated image
     */
    public void start() {
	thread=new Thread(threadGroup,src);
	thread.start();
	repaint();
    }

    /**
     * The stop method stops the animation thread
     */
    public void stop() {
	if(thread!=null)
	    thread.stop();
	thread=null;
    }

    public void destroy() {
	src=null;
	img=null;
	images=null;
	System.gc();
    }

    public String getAppletInfo() {
	return "Diaporama $Revision: 1.38 $, Copyright (C) 1997,1998 by Didier Frick (dfrick@dial.eunet.ch)";
    }

    public String[][] getParameterInfo() {
	return pinfo;
    }

    private String pinfo[][] = {
	{ "between", "int", "Number of interpolated images between each image"},
	{ "mainDelay", "int", "Time to display a non-interpolated image (ms)"},
	{ "delay", "int", "Time to display an interpolated image (ms)"},
	{ "link", "URL", "Document to show when user clicks on applet"},
	{ "target", "String", "Frame in which to display link"},
	{ "message", "String", "Text to display in status bar when mouse cursor enters applet"},
	{ "image1", "URL", "First image. Used via Applet.getImage"},
	{ "image2", "URL", "Next image. And so on... (without gaps)"}
    };

    /**
     * Display message if mouse cursor enters applet.
     */
    public boolean mouseEnter(Event evt,
			     int x,
			     int y) {
	showStatus(message);
	return true;
    }

    /**
     * Display linked document if mouse clicked
     */
    public boolean mouseDown(Event evt,
			     int x,
			     int y) {
	if(link!=null)
	    getAppletContext().showDocument(link,target);
	return true;
    }

}

A voir également:

5 réponses

Deathwing Messages postés 97 Date d'inscription samedi 27 septembre 2008 Statut Membre Dernière intervention 19 mars 2010 14
21 janv. 2009 à 10:19
Personne n'a une idée???
0
tarek_dotzero Messages postés 817 Date d'inscription jeudi 19 juillet 2007 Statut Membre Dernière intervention 12 avril 2022 120
21 janv. 2009 à 10:31
Salut,

J'ai pensé que je connais un peu java mais là je reste bloqué sur ce truc:

   static {
	try {
	    String vendor=System.getProperty("java.vendor").toLowerCase();
	    String os=System.getProperty("os.name").toLowerCase();
	    minimal=vendor.startsWith("netscape")&&os.startsWith("mac");
	} catch(Exception xc) {
	    xc.printStackTrace();
	}
    }




Est ce que ça marche?

( Java déplace les initialisations des variables vers le constructeur, donc la fontion "init" en Applet).
0
Deathwing Messages postés 97 Date d'inscription samedi 27 septembre 2008 Statut Membre Dernière intervention 19 mars 2010 14
21 janv. 2009 à 15:03
J'en ai vraiment aucune idée. Ce programme je l'ai récupéré sur le net
C'est un gars qui l'a mis en téléchargement et je l'ai juste récupéré. Moi perso je n'y connait pratiquement rien en java.
Et ce que je tyrouve surtout bizarre c'est que lorsque je l'essaye en local l'applet se charge nikel mais dès que je le met en ligne sa coince.
0
Deathwing Messages postés 97 Date d'inscription samedi 27 septembre 2008 Statut Membre Dernière intervention 19 mars 2010 14
22 janv. 2009 à 10:28
personne???
0

Vous n’avez pas trouvé la réponse que vous recherchez ?

Posez votre question
Deathwing Messages postés 97 Date d'inscription samedi 27 septembre 2008 Statut Membre Dernière intervention 19 mars 2010 14
23 janv. 2009 à 08:17
vraiment personne??
0