begin process at 2010 09 06 05:23:41
  Trouver un code source :
 
dans
 
Accueil > 

Code

 > 

Api

 > PROBLÈME NULL POINTER EXCEPTION DANS UNE APPLET GRAPHIQUE

PROBLÈME NULL POINTER EXCEPTION DANS UNE APPLET GRAPHIQUE


 Information sur la source

Note :
Aucune note
Catégorie :Api Classé sous :exception, null, pointer, applet, graphique Niveau :Débutant Date de création :05/10/2002 Date de mise à jour :05/10/2002 05:11:54 Vu :4 861

Auteur : martinph

Ecrire un message privé
Site perso
Commentaire sur cette source (0)
Ajouter un commentaire et/ou une note

 Description

Bonjour, je développe une applet qui doit récupérer des mesures de pression en bits sur MATLAB et je doit afficher les graphiques de ces mesures en continue et en VECTOR puisque le "tableau" doit s'adapter à la taille exacte de chaque fichier de données à lire , cet applet doit etre réutilisable pour de nombreux fichiers différents en taile et tracer les courbes correspondants , il faut de plus inverser les bits de poids fort etde poids faible .je ne vois pas pourquoi les parametres de temps ne passent pas , et pourquoi l'execution de l'applet plante .
ci joint code Pisteb990.java
//package stage2;
   import javax.swing.*;
   import java.awt.geom.*;
   import java.applet.*;
   import java.io.*;
   import java.net.*;
   import java.awt.*;
   import java.awt.event.*;
   import java.util.*;
   import java.awt.BorderLayout;
   import java.lang.*;
   import java.math.*;
   import java.awt.Graphics;
   import java.lang.Object.*;
   import java.util.Timer;


   public class Pisteb990 extends Applet implements  ActionListener, Runnable
  
  
   {
  
  
      Color couleur,couleur1;
      Font f=new Font("TimesRoman", Font.BOLD, 12);
      int indexPiste, indexVitesse,vitesse,indexSuite, depart, count;
      int reste, countb,valeur,pas,hauteur,longueur,largeur,vit, x, i,j, indice_a , indice_b , indice_c , indice_d ,fin;
      int m,n,t1,t2,pst1_a,pst1_b ,pst2_a,pst2_b,pst3_a,pst3_b ,pst4_a,pst4_b;
      short tmp, maxi=0,mini=3000;
      float val1, val2, val3, val4 ;
      float el_1,el_2,el_3,el_4;
      boolean debut, effacer, suivant, precedent;
      int xh[],yh[],xv[],yv[];
      String s, max, min, st,piste,pression,suite,fichier;
     //int tempsmaxi=3600;
      Thread thread;
      Image img;
      Graphics g;
      TextArea messageBox = new TextArea();
  
      Vector piste1,piste2,piste3,piste4,t, courbe1, courbe2,courbe3,courbe4 ;
  
      URL u ;
  
      InputStream flux;
      DataInputStream data;
      BorderLayout borderLayout2 = new BorderLayout();
      Choice choixFichier = new Choice();
      Choice choixSuite = new Choice();
      Panel p1 = new Panel();
      Choice choixPression = new Choice();
      Scrollbar js2 = new Scrollbar();
      Panel p2 = new Panel();
      BorderLayout borderLayout1 = new BorderLayout();
      Panel p3 = new Panel();
      Button initialiser = new Button();
      Button avancer = new Button();
      Button stop = new Button();
      Button pause = new Button();
      Choice choixVitesse = new Choice();
      Choice choixPiste = new Choice();
      FlowLayout flowLayout1 = new FlowLayout();
   //Dialog tailleTemps = new Dialog(this,"taille du vector temps = ";true);
  
   //************************************************ ***************
   //**** METHODE INIT()********************************************
   //************************************************ ***************
      public void init()
      {
      
      
      
         couleur = new Color(200, 255, 255);
         couleur1= new Color(220,220,220);
         largeur = getSize().width;
         hauteur = getSize().height;
      
         img     = createImage(largeur,hauteur);
         g       = img.getGraphics();
         setBackground(couleur);
      
      ////////////// création du 1er Pannel avec Listes déroulantes //////////////////////////////////////////////
      
         Panel p1 = new Panel();
      
      
         choixVitesse = new Choice();
         choixVitesse.add("Vitesse");
         choixVitesse.add("Lent");
         choixVitesse.add("Moyen");
         choixVitesse.add("Rapide");
         vitesse = choixVitesse.getSelectedIndex();
      
      
         choixPiste  = new Choice();
         choixPiste.add("Piste");
         choixPiste.add("Piste1");
         choixPiste.add("Piste2");
         choixPiste.add("piste3");
         choixPiste.add("piste4");
         piste = choixPiste.getSelectedItem();
      
      
         choixPression = new Choice();
         choixPression.add("Pression");
         choixPression.add("Bar");
         choixPression.add("mm Hg");
         pression  = choixPression.getSelectedItem();
      
      
         choixFichier = new Choice() ;
         choixFichier.add("DA030410");
         choixFichier.addItem("fich1.dat");
         choixFichier.addItem("fich2.dat");
         fichier = choixFichier.getSelectedItem();
      
      
         choixSuite = new Choice();
         choixSuite.add("Suite ?");
         choixSuite.add("effacer");
         choixSuite.add("début");
         choixSuite.add("suivant");
         choixSuite.add("précedent");
         suite  = choixSuite.getSelectedItem();
      
         p1.setBackground(Color.orange);
         p1.setLayout(flowLayout1);
         choixVitesse.setBackground(Color.green);
         choixFichier.setBackground(Color.cyan);
         choixSuite.setBackground(Color.yellow);
         this.setBackground(Color.lightGray);
      
         this.setLayout(borderLayout2);
         this.add(p1, BorderLayout.NORTH);
         p1.add(choixPiste, null);
         p1.add(choixVitesse, null);
         p1.add(choixPression, null);
         p1.add(choixSuite, null);
         p1.add(choixFichier, null);
      
      
      
      
      ////////// création du 2ème  Panel  avec scrollBar , qui doit accueillir le graphe des mesures ////////////////////////
      
         Panel p2 = new Panel();
         Scrollbar js2 = new Scrollbar(Scrollbar.VERTICAL,0,1,0,255);
         this.add(p2,BorderLayout.EAST);
         p2.add(js2,BorderLayout.EAST);
      
      
      
      
      //////// création du 3ème panel avec Boutons de commandes de défilement ///////////////////////////////////////////
      
         Panel p3 = new Panel();
         this.add(p3,BorderLayout.SOUTH);
         p3.setBackground(Color.lightGray);
      
         stop = new Button("STOP");
         stop.setBackground(Color.red);
         stop.setLabel("STOP");
         stop.addActionListener(this);
         p3.add(stop,null);
      
      
         initialiser = new Button("RESET");
         initialiser.setBackground(Color.cyan);
         initialiser.setLabel("RESET");
         initialiser.addActionListener(this);
         p3.add(initialiser,null);
      
         avancer = new Button("START");
         avancer.setBackground(Color.green);
         avancer.setLabel("START");
         avancer.addActionListener(this);
         p3.add(avancer,null);
      
         pause = new Button("PAUSE");
         pause.setBackground(SystemColor.inactiveCaptionTex t);
         pause.setLabel("PAUSE");
         pause.addActionListener(this);
         p3.add(pause,null);
      
      
         p1.setVisible(true);
         p2.setVisible(true);
         p3.setVisible(true);
      
      
         Vector courbe1 = new Vector();
         Vector courbe2 = new Vector();
         Vector courbe3 = new Vector();
         Vector courbe4 = new Vector();
      
         Vector piste1 = new Vector();
         Vector piste2 = new Vector();
         Vector piste3 = new Vector();
         Vector piste4 = new Vector();
         Vector t      = new Vector(3600);
         Timer timer = new Timer();
         TimerTask task = new MaTask();
      
      
      
         xh=new int[50];
         yh=new int[50];
         xv=new int[50];
         yv=new int[50];
      
         indice_a =0;
         indice_b =0;
         indice_c =0;
         indice_d =0;
      
         xh[0]=40;
         yv[0]=0;
         fin = 0;
         pas=3;
         depart=0;
         count=520*pas;
      
      
         Integer a = new Integer(indice_a) ;
         courbe1.addElement(a);
         Integer b = new Integer(indice_b) ;
         courbe2.addElement(b);
         Integer c = new Integer(indice_c) ;
         courbe3.addElement(c);
         Integer d = new Integer(indice_d) ;
         courbe4.addElement(d);
      
      
      
         debut=true;
         effacer=true;
         reste=0;
         countb=0;
      
      
      
      }
  
   //************************************************ ************************************************** *************************
   //************************************************ ************************************************** *************************
  
  
  
  
  
  
  
   //************************************************ ************************************************** **********
   //**** METHODE ACTION PERFORMED(ACTION EVENT E)************************************************ ***************
   //************************************************ ************************************************** **********
   //************************************************ ************************************************** **********
  
  
  
  
      public void actionPerformed(ActionEvent e)
      {
      
      
         if((e.getActionCommand()=="RESET"))
         {
            depart=0;
            count=520*pas;
            debut=false;
            effacer=true;
         }// fin 1er if
      
      
         if((e.getActionCommand()=="STOP"))
         {
            effacer=false;
            debut=false;
            this.stop();
         }// fin 2ème if
      
      
      
      
      //************************************************ ************************************************** ********
      
      
      
         if((e.getActionCommand()=="START"))
         {
         //Timer timer = new Timer();
         //TimerTask task = new MaTask();
         //timer.schedule( task, 1000, 500 );
        
            debut=true;
            effacer=true;
         //tt.scheduleAtFixedRate(thread.run(),0,1000) ;
         //ReadBits rb = new ReadBits();
            this.start();
        
         //for(i=1;i<t.size();i++)
            for(i=1;i<=3600;i++)
            {
               float var = i/pas+40;
               Float wt = new Float(var);
               Integer newI = new Integer(i);
               t.set(i,wt);// problème "NULL POINTER EXCEPTION" à l'éxécution de l'applet
            
               try
               {
                  URL u = new URL(getDocumentBase(), fichier);
                  flux = u.openStream();
                  data = new DataInputStream(flux);
                  valeur=0;
              
                  try
                  {
                   // boucle continue
                     while (true)
                     {
                    
                        valeur = data.readUnsignedShort();//  marche  puisque readUnsignedShort retourne "an int value"
                        Float wa = new Float(valeur);
                        reste= countb%4;
                    
                        switch(reste)
                        {
                           case 0 :
                              Integer nexta = new Integer(indice_a++);
                              courbe1.set(indice_a++,wa);
                              break;
                        
                           case 1 :
                              Integer nextb = new Integer(indice_b++);
                              courbe2.set(indice_b++,wa);
                              break;
                        
                           case 2 :
                              Integer nextc = new Integer(indice_c++);
                              courbe3.set(indice_c++,wa);
                              break;
                        
                           case 3 :
                              Integer nextd = new Integer(indice_d++);
                              courbe4.set(indice_d++,wa);
                              break;
                        }// fin switch
                    
                        countb++;
                        break;
                     }//fin while
                  //this.start();
                  }// fin 2ème try
                  
                  
                     catch(EOFException e1)
                     {
                        flux.close();
                     }//fin 2ème catch
              
               }//fin  1er try
              
                  catch(IOException e1)
                  {
                     System.out.println("Erreur --"+e1.toString());
                  }// fin 1er catch
            
               longueur = countb/4;
            
            }//fin 1er for
        
         //************************************************ ************************************************** **************
            for(j=0;j<piste1.size();j++)
            {
            
               float el1 = ((Float)courbe1.elementAt(j)).floatValue();
               val1 = 180-(el1-2000)/5+40 ;
               Float v1 = new Float(val1);
               piste1.addElement(v1);
            }
        
            for(j=0;j<piste2.size();j++)
            {
               float el2 = ((Float)courbe2.elementAt(j)).floatValue();
               val2 = 180-(el2-2000)/5+60 ;
               Float v2 = new Float(val2);
               piste2.addElement(v2);
            }
        
            for(j=0;j<piste3.size();j++)
            {
               float el3 = ((Float)courbe3.elementAt(j)).floatValue();
               val3 = 180-(el3-2000)/5+180 ;
               Float v3 = new Float(val3);
               piste3.addElement(v3);
            }
        
            for(j=0;j<piste4.size();j++)
            {
               float el4 = ((Float)courbe4.elementAt(j)).floatValue();
               val4 = 180-(el4-2000)/5+300 ;
               Float v4 = new Float(val4);
               piste4.addElement(v4);
            }
        
        
        
        
        
        
        
        
        
        
         } //fin de if (getSource()==avancer)
      
      }//fin de actionPerformed()
  
  
  
  
  
  
   /************************************************* ******************************
   ************* METHODE PAINT (GRAPHICS G) *****************************************
   ************************************************** *****************************/
  
  
  
  
      public void paint(Graphics g1)
      {
      
         indexPiste   = choixPiste.getSelectedIndex();
         indexVitesse = choixVitesse.getSelectedIndex();
         indexSuite   = choixSuite.getSelectedIndex();
        //Timer timer = new Timer();
        //TimerTask task = new MaTask();
        //timer.schedule( task, 1000, 500 );
      
         switch(indexVitesse)
         {
            case 1:
               vit=30;
               break;
            case 2:
               vit=100;
               break;
            case 3:
               vit=200;
               break;
            case 0:
               vit=100;
               break;
         }//fin switch(indexVitesse)
      
      
      
      
         switch(indexSuite)
         {
            case 1:// le cas ou indexSuite ="effacer";
            
               g.clearRect(0,0,largeur,hauteur);//efface et réinitialise
               g.setColor(couleur);
            
               g.fillRect (1, 1, largeur-2, hauteur-2);
               g.setColor(couleur1);
            
               for(i=1;((xh[i-1]+20)<560);i++)   //pour graduer l'axe des x
               {
                  xh[i]=xh[i-1]+40;
                  g.drawLine(xh[i],0,xh[i],480);
                // g.setColor(Color.blue);
                  //g.drawLine(795,497,800,560);      //les extremites des axes: les fléches pour l'axe des x
               //    g.drawLine(795,503,800,560);
               //g.setColor(Color.red);
               }// fin 1er for
            
            
               for(i=1;((yv[i-1]+20)<560);i++)  // pour  graduer l'axe des y
               {
                  yv[i]=yv[i-1]+40;
                  g.drawLine(40,yv[i],560,yv[i]);
               //   g.setColor(Color.blue);
                  g.drawLine(37,5,40,0);             // les extremites des axes: les fléches pour l'axe des y
                  g.drawLine(43,5,40,0);
               // g.setColor(Color.red);
              
               }// fin 2ème for
            
               g.setColor(Color.red);
               g.drawLine(40,480,560,480);   //axe horizontal des x dans le repère
               g.drawLine(40,480,40,0);      // axe vertical des y  dans le repère
               g.drawString("(s)",545,495);
               g.drawString(String.valueOf(pas*2)+"s",90,78);
               g.drawString("200",60,65);
               g.drawLine(80,80,120,80);
               g.drawLine(80,80,120,80);
               effacer = false;
            
               break;
        
        
        
        
            case 2 : // le cas ou : indexSuite = "debut" ;
            
            //g.clearRect(0,0,largeur,hauteur);
                        //g.setColor(couleur);
            
             //g.fillRect (1, 1, largeur-2, hauteur-2);
             //g.setColor(couleur1);
             //effacer=false;
                         //g.setColor(Color.cyan);
            
               g.drawString("/"+String.valueOf(longueur/1200)+"mi n"+String.valueOf((longueur/20)%60)+"s",500,40);
             // -> ???
            
               //for(int i=0;i<=t.size();i++)
               for(int i=1;i<=3600;i++)
               {
                  t1 = ((Integer)t.elementAt(i)).intValue();//!!!le vector t est vide !!!puisqu'aucun temps ne lui est passé!!!
               //t1 = ((Integer)(timer)).intValue();
                  t2 = ((Integer)t.elementAt(i+1)).intValue();
                  //t2 = ((Integer)(timer)).intValue();
                  messageBox.append("valeur de  t1 = "+t1);
               }
            
               for(int j=0;j<piste1.size();j++)
               {
                  pst1_a = ((Integer)piste1.elementAt(j)).intValue();
                  pst1_b = ((Integer)piste1.elementAt(j+1)).intValue();
               }
            
               for(int j=0;j<piste2.size();j++)
               {
                  pst2_a = ((Integer)piste2.elementAt(j)).intValue();
                  pst2_b = ((Integer)piste2.elementAt(j+1)).intValue();
               }
            
               for(int j=0;j<piste3.size();j++)
               {
                  pst3_a = ((Integer)piste3.elementAt(j)).intValue();
                  pst3_b = ((Integer)piste3.elementAt(j+1)).intValue();
               }
            
               for(int j=0;j<piste4.size();j++)
               {
                  pst4_a = ((Integer)piste4.elementAt(j)).intValue();
                  pst4_b = ((Integer)piste4.elementAt(j+1)).intValue();
               }
            
               g.setColor(Color.blue);
            
             //switch(indexPiste)
               //     {
               //     case 1:
               for(i=0,j=0;(i<count-1)&&(i<longueur);i++,j+ +)
               {
                  g.drawLine(t1,pst1_a,t2,pst1_b); // g.drawLine(x1,y1,x2,y2)
              
                  g.setColor(Color.blue);
               }
                //      break;
               // case 2:
               for( i=0, j=0; (i<count-1)&&(i<longueur); i++, j++)
               {
                  g.drawLine(t1,pst2_a,t2,pst2_b);
              
                  g.setColor(Color.blue);
               }
                 //      break;
               // case 3:
               for( i=0, j=0; (i<count-1)&&(i<longueur); i++, j++)
               {
                  g.drawLine(t1,pst3_a,t2,pst3_b);
              
                  g.setColor(Color.blue);
               }
             // break;
             //  case 4:
               for( i=0, j=0; (i<count-1)&&(i<longueur); i++, j++)
               {
                  g.drawLine(t1,pst4_a,t2,pst4_b);
              
                  g.setColor(Color.blue);
               }
             //  break;
            
             // }// fin 2ème  switch(indexPiste)
            
            
            
            
            case 3: //le cas indexSuite = "suivant";
               g.clearRect(0,0,largeur,hauteur);
               g.setColor(couleur);
               g.fillRect (1, 1, largeur-2, hauteur-2);
               effacer=false;
               break;
            case 4: //le cas indexSuite = "precedent";
               g.clearRect(0,0,largeur,hauteur);
               g.setColor(couleur);
               g.fillRect (1, 1, largeur-2, hauteur-2);
               effacer=false;
            
               break;
        
        
        
         }// fin 1er switch(indexSuite)
      
      
         g1.setFont(f);
      
      
      
      //////
         for(int k=0; k<7; k++)//...????????????
         {
            g.drawString(String.valueOf(4*pas*k+depart/20), 40+k*80-5, 495);
            min=String.valueOf(((520*pas+depart)/20)%60);
            s=String.valueOf(((520*pas+depart)/20)%60);
            g.setColor(Color.black);
            g.drawString(min+"min"+s,458,40);
            g.setColor(Color.blue);
        
            if(longueur-count > 20)
            {
               count += 20;
               depart +=20;
            }// fin if
            
            
            else
            {
               count += longueur-count;
               depart += longueur-count;
            //}// fin else
            
               effacer=true;
            }
         }//fin for
      
         g1.drawImage(img,0,0,this);
      }
  
   //************************************************ ************************************************** ************************
   //**************METHODE  UPDATE(GRAPHICS)********************************** ************************************************** *****************
   //************************************************ ************************************************** *************************
  
  
      public void update(Graphics g1)
      {
         paint(g1);
      }
  
  
   /************************************************* ******************************
   ************METHODE START********************************************* *********
   ************************************************** ****************************/
      public void start()
      {
         if (thread==null)
         {
            thread=new Thread(this);
            thread.start();
         }
      }
   /************************************************* ******************************
   ********************METHODE STOP ***********************************************
   ************************************************** *****************************/
      public void stop()
      {
      
      
         thread=null;
      
      }
   /************************************************* ***************************
   ********************** METHODE RUN ******************************************
   ************************************************** **************************/
      public void run()
      {
         Thread thisThread=Thread.currentThread();
         while((thread==thisThread)&&(thread!=null))
         {
            repaint();
            try
            {
               Thread.sleep(vit);
            }
               catch(InterruptedException e)
               {
                  if(count==longueur)
                  {
                     count=0;
                  }
               }
         }
      }
  
   //************************************************ ************************************************** **************
   //**************** CONVERSION / INVERSION   DES BITS LUS (2 A 2 ) ************************************************** **
   //************************************************ ************************************************** *****************
   /*
   public void conversion()
   { int m,n;
   short tmp, maxi=0,mini=0;
  
   URL u = new URL(getDocumentBase(), fichier);
   flux = u.openStream();
  
   Vector f1  = new Vector();
   Vector f2  = new Vector();
  
   DataInputStream data1  = new DataInputStream(flux);
   //valeur1 = data1.readUnsignedShort();
   Short wa1 = new Short(valeur);
   //************************************************ ***************************************
   //DataInputStream data2 = new DataInputStream(flux);
   //valeur2 = data2.readUnsmgnedShort();
   //Float wa2 = new Float(valeur2);
  
   for(m=0;m<f1.size();m+=2)
   {for(n=0;n<f2.size();n+=2)
   {
   f1.set(m,wa1);
   //f2.set(n,wa2);
   //f2.elementAt(n)=f1.elementAt(m+1);
   //f2.elementAt(n+1)=f1.elementAt(m);
   //Short fs1 = new Short(f1);
   //Short fs2= new Short(f2);
   short shf1a = ((short)(f1.elementAt(m)).shortValue());
   short shf1b = ((short)(f1.elementAt(m+1)).shortValue());
   short shf2a = ((short)(f2.elementAt(n)).shortValue());
   short shf2b = ((short)(f2.elementAt(n+1)).shortValue());
   shf2a=shf1b;
   shf1a=shf2b;
   if(maxi<shf1b)
   {
   maxi=shf1b;
   }
  
   if((shf1a!=0)&&(mini>shf1a))
   {
   mini=shf1a;
   }
   }//fin du 1erfor
   }//fin du 2ème for
   /*try
   {
   f2.exists();
   }
   catch{
   System.out.println("impossible d'ouvrir le fichier f2");
   }//fin catch
  
   }//fin methode void convers()
  
  
   */
   //************************************************ ************************************************** ****************
   //************************************************ ************************************************** **************
   //************************************************ ************************************************** *****************
  
   //}
  
      public class MaTask extends TimerTask
      {
         public void run()
         {
            thread.run();
         }
      }
   }// fin de la classe Pisteb999

//code Pisteb990.html
<html>
  
  <head>
    <title> applet</title>
  </head>
  
  <body>
    <h1>Visualisation: </h1>
    <applet code="Pisteb999.class"  height=500 width=560 align=ABSMIDDLE>ici l'applet
    </applet>
  </body>

</html>

Ce qu'il faut obtenir comme courbes graphiques ressemble à l'execution de  Courbe6.java :

   import java.awt.geom.*;
   import java.applet.*;
   import java.io.*;
   import java.net.*;
   import java.awt.*;
   import java.awt.event.*;


   public class Courbe6  extends Applet implements Runnable, ActionListener
   {   Font f=new Font("TimesRoman", Font.BOLD, 30);
      int piste1[], piste2[], piste3[], piste4[], t[];
      int indexPiste, indexVitesse, depart, count, pas, vitesse, hauteur, largeur, x,longueur;
      boolean debut, effacer, suivant, precedent;
      int xh[],yh[],xv[],yv[];
      String s, min, st;
  
      Button avancer, initialiser, stop;
      Choice choixVitesse, fichier;
  
      Color couleur, couleur1;
      Thread thread;
      Image img;
      Graphics g;
      URL u;
      InputStream flux;
      DataInputStream data;
  
      public void init()
      {    largeur=getSize().width;
         hauteur=getSize().height;
         img=createImage(largeur,hauteur);
         g=img.getGraphics();
         couleur=new Color(200, 255, 255);
         couleur1=new Color(220,220,220);
      
      
         xh=new int[50];
         yh=new int[50];
         xh=new int[50];
         xv=new int[50];
         yv=new int[50];
      
         xh[0]=40;
         yv[0]=0;
         pas=3;
         depart=0;
         count=520*pas;
      
         debut=true;
         effacer=true;
      
         initialiser=new Button("  ");
         initialiser.setBackground(Color.black);
         initialiser.addActionListener(this);
         add(initialiser);
      
         stop=new Button("||");
         stop.setBackground(couleur1);
         stop.addActionListener(this);
         add(stop);
      
         avancer=new Button("->");
         avancer.setBackground(couleur1);
         avancer.addActionListener(this);
         add(avancer);
      
         choixVitesse=new Choice();
         add(choixVitesse);
         choixVitesse.addItem("vitesse");
         choixVitesse.addItem("rapide");
         choixVitesse.addItem("moyen");
         choixVitesse.addItem("lent");
      
      
         fichier=new Choice();
         add(fichier);
         fichier.addItem("fich1.dat");
         fichier.addItem("fich2.dat");
      }
  
  
      public void actionPerformed(ActionEvent e)
      { int indice1=0, indice2=0, indice3=0, indice4=0;
         int reste,fin=0;
         int courbe1[]=new int [5000];
         int courbe2[]=new int [5000];
         int courbe3[]=new int [5000];
         int courbe4[]=new int [5000];
      
         if(e.getSource()==initialiser){depart=0; count=520*pas; debut=false; effacer=true;}
         if(e.getSource()==stop){ effacer=false; debut=false;}
      
         if(e.getSource()==avancer)
         { debut=true;
            effacer=true;
        
            try
            { u=new URL (getDocumentBase(), fichier.getSelectedItem());
               flux=u.openStream();
               data=new DataInputStream(flux);
            
               try
               {  
                  while(true)
                  { int valeur=data.readUnsignedShort();
                     reste=fin%4;
                  
                     switch(reste)
                     {
                        case 0: courbe1[indice1++]=valeur;
                           break;
                        case 1: courbe2[indice2++]=valeur;
                           break;
                        case 2: courbe3[indice3++]=valeur;
                           break;
                        case 3: courbe4[indice4++]=valeur;
                           break;
                     }
                     fin++;
                  }
              
               }
                  catch(EOFException e1){
                     flux.close();}
            
            
            }
               catch(IOException e1){
                  System.out.println("Erreur --"+e1.toString());}
        
            longueur=fin/4;
        
            piste1=new int[longueur];
            piste2=new int[longueur];
            piste3=new int[longueur];
            piste4=new int[longueur];
            t=new int[longueur];
        
            for(int i=0;i<longueur;i++)
            { piste1[i]=180-(courbe1[i]-2000)/5-40;
               piste2[i]=180-(courbe2[i]-2000)/5+60;
               piste3[i]=180-(courbe3[i]-2000)/5+180;
               piste4[i]=180-(courbe4[i]-2000)/5+300;
               t[i]=i/pas+40;
            }
        
         }
      
      }
  
      public void update(Graphics g1)
      { paint(g1);
      }
  
      public void paint(Graphics g1)
      {
         if(effacer)
         { g.clearRect(0,0,largeur,hauteur);
            g.setColor(couleur);
            g.fillRect (1, 1, largeur-2, hauteur-2);
            g.setColor(couleur1);
        
            for(int i=1; (xh[i-1]+20)<560; i++)   //pour graduer l'axes des x
            { xh[i]=xh[i-1]+40;
               g.drawLine(xh[i],0,xh[i],480);
            }
        
            for(int i=1; ((yv[i-1]+20)<480); i++)     //pour graduer l'axe des y
            { yv[i]=yv[i-1]+40;
               g.drawLine(40,yv[i],560,yv[i]);
            }
        
            g.setColor(Color.red);
            g.drawLine(40,480,560,480);        //axe des x
            g.drawLine(40,480,40,0);           // axe des y
            g.drawString("(s)",545,495);
            g.drawString(String.valueOf(pas*2)+" s",90,78);
            g.drawString("200",60,65);
            g.drawLine(80,40,80,80);
            g.drawLine(80,80,120,80);
        
            effacer=false;
         }
         //g.setFont(f);
         indexVitesse=choixVitesse.getSelectedIndex();
      
         switch(indexVitesse)
         {
            case 1:vitesse=30;
               break;
            case 2:vitesse=100;
               break;
            case 3:vitesse=200;
               break;
            case 0:vitesse=100;
               break;
         }
      
      
         if(debut)
         { g.setColor(Color.black);
            g.drawString("/" +String.valueOf(longueur/1200)+" min "+String.valueOf((longueur/20)%60) +"s", 500, 40);
            g.setColor(Color.blue);
        
            for(int i=depart, j=0; (i<count-1)&&(i<longueur); i++, j++)
               g.drawLine(t[j],piste1[i],t[j+1],piste1[i+1]);
        
            for(int i=depart, j=0; (i<count-1)&&(i<longueur); i++, j++)
               g.drawLine(t[j],piste2[i],t[j+1],piste2[i+1]);
        
            for(int i=depart, j=0; (i<count-1)&&(i<longueur); i++, j++)
               g.drawLine(t[j],piste3[i],t[j+1],piste3[i+1]);
        
            for(int i=depart, j=0; (i<count-1)&&(i<longueur); i++, j++)
               g.drawLine(t[j],piste4[i],t[j+1],piste4[i+1]);
        
            for(int k=0; k<7; k++) g.drawString(String.valueOf(4*pas*k+depart/20), 40+k*80-5, 495);
            min=String.valueOf(((520*pas+depart)/20)/60);
            s=String.valueOf(((520*pas+depart)/20)%60);
            g.setColor(Color.black);
            g.drawString(min+" min "+s,458,40);
            g.setColor(Color.blue);
        
            if((longueur-count)>20) {count += 20; depart += 20;}
            else{count += longueur-count; depart += longueur-count;}
            effacer=true;
         }
      
         g1.drawImage(img,0,0,this);
      }
  
  
      public void run()
      { Thread thisThread=Thread.currentThread();
         while((thread==thisThread)&&(thread!=null))
         { repaint();
            try
            { Thread.sleep(vitesse);
            }
               catch(InterruptedException e) {
                  if(count==longueur)count=0;}
         }
      }
  
      public void start()
      {
         if (thread==null)
         {thread=new Thread(this);
            thread.start();
         }
      }
  
      public void stop()
      {thread=null;
      }
  
  
   }

et son Courbe6.html :
<html>
  
  <head>
    <title> applet</title>
  </head>
  
  <body>
    <h1>Visualisation: </h1>
    <applet code="Courbe6.class"  height=500 width=560 align=ABSMIDDLE>ici l'applet
    </applet>
  </body>

</html>

Pouvez vous me conseiller utilement , pour le Null pointer Exception sur le temps et l'inversion des bits de poids fort et de poids faible du fichier de données lus en transtypées dans des VECTOR pour ensuite etre retranstypées en objets puis en variables , et etre rentrées dans des équations  puis etre affichées graphiquement en continue en fonction du temps en abscisse et de la presion en ordonnées .

Merci
martinph399@free.fr



Source

  • //package stage2;
  • import javax.swing.*;
  • import java.awt.geom.*;
  • import java.applet.*;
  • import java.io.*;
  • import java.net.*;
  • import java.awt.*;
  • import java.awt.event.*;
  • import java.util.*;
  • import java.awt.BorderLayout;
  • import java.lang.*;
  • import java.math.*;
  • import java.awt.Graphics;
  • import java.lang.Object.*;
  • import java.util.Timer;
  • public class Pisteb990 extends Applet implements ActionListener, Runnable
  • {
  • Color couleur,couleur1;
  • Font f=new Font("TimesRoman", Font.BOLD, 12);
  • int indexPiste, indexVitesse,vitesse,indexSuite, depart, count;
  • int reste, countb,valeur,pas,hauteur,longueur,largeur,vit, x, i,j, indice_a , indice_b , indice_c , indice_d ,fin;
  • int m,n,t1,t2,pst1_a,pst1_b ,pst2_a,pst2_b,pst3_a,pst3_b ,pst4_a,pst4_b;
  • short tmp, maxi=0,mini=3000;
  • float val1, val2, val3, val4 ;
  • float el_1,el_2,el_3,el_4;
  • boolean debut, effacer, suivant, precedent;
  • int xh[],yh[],xv[],yv[];
  • String s, max, min, st,piste,pression,suite,fichier;
  • //int tempsmaxi=3600;
  • Thread thread;
  • Image img;
  • Graphics g;
  • TextArea messageBox = new TextArea();
  • Vector piste1,piste2,piste3,piste4,t, courbe1, courbe2,courbe3,courbe4 ;
  • URL u ;
  • InputStream flux;
  • DataInputStream data;
  • BorderLayout borderLayout2 = new BorderLayout();
  • Choice choixFichier = new Choice();
  • Choice choixSuite = new Choice();
  • Panel p1 = new Panel();
  • Choice choixPression = new Choice();
  • Scrollbar js2 = new Scrollbar();
  • Panel p2 = new Panel();
  • BorderLayout borderLayout1 = new BorderLayout();
  • Panel p3 = new Panel();
  • Button initialiser = new Button();
  • Button avancer = new Button();
  • Button stop = new Button();
  • Button pause = new Button();
  • Choice choixVitesse = new Choice();
  • Choice choixPiste = new Choice();
  • FlowLayout flowLayout1 = new FlowLayout();
  • //Dialog tailleTemps = new Dialog(this,"taille du vector temps = ";true);
  • //***************************************************************
  • //**** METHODE INIT()********************************************
  • //***************************************************************
  • public void init()
  • {
  • couleur = new Color(200, 255, 255);
  • couleur1= new Color(220,220,220);
  • largeur = getSize().width;
  • hauteur = getSize().height;
  • img = createImage(largeur,hauteur);
  • g = img.getGraphics();
  • setBackground(couleur);
  • ////////////// création du 1er Pannel avec Listes déroulantes //////////////////////////////////////////////
  • Panel p1 = new Panel();
  • choixVitesse = new Choice();
  • choixVitesse.add("Vitesse");
  • choixVitesse.add("Lent");
  • choixVitesse.add("Moyen");
  • choixVitesse.add("Rapide");
  • vitesse = choixVitesse.getSelectedIndex();
  • choixPiste = new Choice();
  • choixPiste.add("Piste");
  • choixPiste.add("Piste1");
  • choixPiste.add("Piste2");
  • choixPiste.add("piste3");
  • choixPiste.add("piste4");
  • piste = choixPiste.getSelectedItem();
  • choixPression = new Choice();
  • choixPression.add("Pression");
  • choixPression.add("Bar");
  • choixPression.add("mm Hg");
  • pression = choixPression.getSelectedItem();
  • choixFichier = new Choice() ;
  • choixFichier.add("DA030410");
  • choixFichier.addItem("fich1.dat");
  • choixFichier.addItem("fich2.dat");
  • fichier = choixFichier.getSelectedItem();
  • choixSuite = new Choice();
  • choixSuite.add("Suite ?");
  • choixSuite.add("effacer");
  • choixSuite.add("début");
  • choixSuite.add("suivant");
  • choixSuite.add("précedent");
  • suite = choixSuite.getSelectedItem();
  • p1.setBackground(Color.orange);
  • p1.setLayout(flowLayout1);
  • choixVitesse.setBackground(Color.green);
  • choixFichier.setBackground(Color.cyan);
  • choixSuite.setBackground(Color.yellow);
  • this.setBackground(Color.lightGray);
  • this.setLayout(borderLayout2);
  • this.add(p1, BorderLayout.NORTH);
  • p1.add(choixPiste, null);
  • p1.add(choixVitesse, null);
  • p1.add(choixPression, null);
  • p1.add(choixSuite, null);
  • p1.add(choixFichier, null);
  • ////////// création du 2ème Panel avec scrollBar , qui doit accueillir le graphe des mesures ////////////////////////
  • Panel p2 = new Panel();
  • Scrollbar js2 = new Scrollbar(Scrollbar.VERTICAL,0,1,0,255);
  • this.add(p2,BorderLayout.EAST);
  • p2.add(js2,BorderLayout.EAST);
  • //////// création du 3ème panel avec Boutons de commandes de défilement ///////////////////////////////////////////
  • Panel p3 = new Panel();
  • this.add(p3,BorderLayout.SOUTH);
  • p3.setBackground(Color.lightGray);
  • stop = new Button("STOP");
  • stop.setBackground(Color.red);
  • stop.setLabel("STOP");
  • stop.addActionListener(this);
  • p3.add(stop,null);
  • initialiser = new Button("RESET");
  • initialiser.setBackground(Color.cyan);
  • initialiser.setLabel("RESET");
  • initialiser.addActionListener(this);
  • p3.add(initialiser,null);
  • avancer = new Button("START");
  • avancer.setBackground(Color.green);
  • avancer.setLabel("START");
  • avancer.addActionListener(this);
  • p3.add(avancer,null);
  • pause = new Button("PAUSE");
  • pause.setBackground(SystemColor.inactiveCaptionText);
  • pause.setLabel("PAUSE");
  • pause.addActionListener(this);
  • p3.add(pause,null);
  • p1.setVisible(true);
  • p2.setVisible(true);
  • p3.setVisible(true);
  • Vector courbe1 = new Vector();
  • Vector courbe2 = new Vector();
  • Vector courbe3 = new Vector();
  • Vector courbe4 = new Vector();
  • Vector piste1 = new Vector();
  • Vector piste2 = new Vector();
  • Vector piste3 = new Vector();
  • Vector piste4 = new Vector();
  • Vector t = new Vector(3600);
  • Timer timer = new Timer();
  • TimerTask task = new MaTask();
  • xh=new int[50];
  • yh=new int[50];
  • xv=new int[50];
  • yv=new int[50];
  • indice_a =0;
  • indice_b =0;
  • indice_c =0;
  • indice_d =0;
  • xh[0]=40;
  • yv[0]=0;
  • fin = 0;
  • pas=3;
  • depart=0;
  • count=520*pas;
  • Integer a = new Integer(indice_a) ;
  • courbe1.addElement(a);
  • Integer b = new Integer(indice_b) ;
  • courbe2.addElement(b);
  • Integer c = new Integer(indice_c) ;
  • courbe3.addElement(c);
  • Integer d = new Integer(indice_d) ;
  • courbe4.addElement(d);
  • debut=true;
  • effacer=true;
  • reste=0;
  • countb=0;
  • }
  • //***************************************************************************************************************************
  • //***************************************************************************************************************************
  • //************************************************************************************************************
  • //**** METHODE ACTION PERFORMED(ACTION EVENT E)***************************************************************
  • //************************************************************************************************************
  • //************************************************************************************************************
  • public void actionPerformed(ActionEvent e)
  • {
  • if((e.getActionCommand()=="RESET"))
  • {
  • depart=0;
  • count=520*pas;
  • debut=false;
  • effacer=true;
  • }// fin 1er if
  • if((e.getActionCommand()=="STOP"))
  • {
  • effacer=false;
  • debut=false;
  • this.stop();
  • }// fin 2ème if
  • //**********************************************************************************************************
  • if((e.getActionCommand()=="START"))
  • {
  • //Timer timer = new Timer();
  • //TimerTask task = new MaTask();
  • //timer.schedule( task, 1000, 500 );
  • debut=true;
  • effacer=true;
  • //tt.scheduleAtFixedRate(thread.run(),0,1000) ;
  • //ReadBits rb = new ReadBits();
  • this.start();
  • //for(i=1;i<t.size();i++)
  • for(i=1;i<=3600;i++)
  • {
  • float var = i/pas+40;
  • Float wt = new Float(var);
  • Integer newI = new Integer(i);
  • t.set(i,wt);// problème "NULL POINTER EXCEPTION" à l'éxécution de l'applet
  • try
  • {
  • URL u = new URL(getDocumentBase(), fichier);
  • flux = u.openStream();
  • data = new DataInputStream(flux);
  • valeur=0;
  • try
  • {
  • // boucle continue
  • while (true)
  • {
  • valeur = data.readUnsignedShort();// marche puisque readUnsignedShort retourne "an int value"
  • Float wa = new Float(valeur);
  • reste= countb%4;
  • switch(reste)
  • {
  • case 0 :
  • Integer nexta = new Integer(indice_a++);
  • courbe1.set(indice_a++,wa);
  • break;
  • case 1 :
  • Integer nextb = new Integer(indice_b++);
  • courbe2.set(indice_b++,wa);
  • break;
  • case 2 :
  • Integer nextc = new Integer(indice_c++);
  • courbe3.set(indice_c++,wa);
  • break;
  • case 3 :
  • Integer nextd = new Integer(indice_d++);
  • courbe4.set(indice_d++,wa);
  • break;
  • }// fin switch
  • countb++;
  • break;
  • }//fin while
  • //this.start();
  • }// fin 2ème try
  • catch(EOFException e1)
  • {
  • flux.close();
  • }//fin 2ème catch
  • }//fin 1er try
  • catch(IOException e1)
  • {
  • System.out.println("Erreur --"+e1.toString());
  • }// fin 1er catch
  • longueur = countb/4;
  • }//fin 1er for
  • //****************************************************************************************************************
  • for(j=0;j<piste1.size();j++)
  • {
  • float el1 = ((Float)courbe1.elementAt(j)).floatValue();
  • val1 = 180-(el1-2000)/5+40 ;
  • Float v1 = new Float(val1);
  • piste1.addElement(v1);
  • }
  • for(j=0;j<piste2.size();j++)
  • {
  • float el2 = ((Float)courbe2.elementAt(j)).floatValue();
  • val2 = 180-(el2-2000)/5+60 ;
  • Float v2 = new Float(val2);
  • piste2.addElement(v2);
  • }
  • for(j=0;j<piste3.size();j++)
  • {
  • float el3 = ((Float)courbe3.elementAt(j)).floatValue();
  • val3 = 180-(el3-2000)/5+180 ;
  • Float v3 = new Float(val3);
  • piste3.addElement(v3);
  • }
  • for(j=0;j<piste4.size();j++)
  • {
  • float el4 = ((Float)courbe4.elementAt(j)).floatValue();
  • val4 = 180-(el4-2000)/5+300 ;
  • Float v4 = new Float(val4);
  • piste4.addElement(v4);
  • }
  • } //fin de if (getSource()==avancer)
  • }//fin de actionPerformed()
  • /*******************************************************************************
  • ************* METHODE PAINT (GRAPHICS G) *****************************************
  • *******************************************************************************/
  • public void paint(Graphics g1)
  • {
  • indexPiste = choixPiste.getSelectedIndex();
  • indexVitesse = choixVitesse.getSelectedIndex();
  • indexSuite = choixSuite.getSelectedIndex();
  • //Timer timer = new Timer();
  • //TimerTask task = new MaTask();
  • //timer.schedule( task, 1000, 500 );
  • switch(indexVitesse)
  • {
  • case 1:
  • vit=30;
  • break;
  • case 2:
  • vit=100;
  • break;
  • case 3:
  • vit=200;
  • break;
  • case 0:
  • vit=100;
  • break;
  • }//fin switch(indexVitesse)
  • switch(indexSuite)
  • {
  • case 1:// le cas ou indexSuite ="effacer";
  • g.clearRect(0,0,largeur,hauteur);//efface et réinitialise
  • g.setColor(couleur);
  • g.fillRect (1, 1, largeur-2, hauteur-2);
  • g.setColor(couleur1);
  • for(i=1;((xh[i-1]+20)<560);i++) //pour graduer l'axe des x
  • {
  • xh[i]=xh[i-1]+40;
  • g.drawLine(xh[i],0,xh[i],480);
  • // g.setColor(Color.blue);
  • //g.drawLine(795,497,800,560); //les extremites des axes: les fléches pour l'axe des x
  • // g.drawLine(795,503,800,560);
  • //g.setColor(Color.red);
  • }// fin 1er for
  • for(i=1;((yv[i-1]+20)<560);i++) // pour graduer l'axe des y
  • {
  • yv[i]=yv[i-1]+40;
  • g.drawLine(40,yv[i],560,yv[i]);
  • // g.setColor(Color.blue);
  • g.drawLine(37,5,40,0); // les extremites des axes: les fléches pour l'axe des y
  • g.drawLine(43,5,40,0);
  • // g.setColor(Color.red);
  • }// fin 2ème for
  • g.setColor(Color.red);
  • g.drawLine(40,480,560,480); //axe horizontal des x dans le repère
  • g.drawLine(40,480,40,0); // axe vertical des y dans le repère
  • g.drawString("(s)",545,495);
  • g.drawString(String.valueOf(pas*2)+"s",90,78);
  • g.drawString("200",60,65);
  • g.drawLine(80,80,120,80);
  • g.drawLine(80,80,120,80);
  • effacer = false;
  • break;
  • case 2 : // le cas ou : indexSuite = "debut" ;
  • //g.clearRect(0,0,largeur,hauteur);
  • //g.setColor(couleur);
  • //g.fillRect (1, 1, largeur-2, hauteur-2);
  • //g.setColor(couleur1);
  • //effacer=false;
  • //g.setColor(Color.cyan);
  • g.drawString("/"+String.valueOf(longueur/1200)+"min"+String.valueOf((longueur/20)%60)+"s",500,40);
  • // -> ???
  • //for(int i=0;i<=t.size();i++)
  • for(int i=1;i<=3600;i++)
  • {
  • t1 = ((Integer)t.elementAt(i)).intValue();//!!!le vector t est vide !!!puisqu'aucun temps ne lui est passé!!!
  • //t1 = ((Integer)(timer)).intValue();
  • t2 = ((Integer)t.elementAt(i+1)).intValue();
  • //t2 = ((Integer)(timer)).intValue();
  • messageBox.append("valeur de t1 = "+t1);
  • }
  • for(int j=0;j<piste1.size();j++)
  • {
  • pst1_a = ((Integer)piste1.elementAt(j)).intValue();
  • pst1_b = ((Integer)piste1.elementAt(j+1)).intValue();
  • }
  • for(int j=0;j<piste2.size();j++)
  • {
  • pst2_a = ((Integer)piste2.elementAt(j)).intValue();
  • pst2_b = ((Integer)piste2.elementAt(j+1)).intValue();
  • }
  • for(int j=0;j<piste3.size();j++)
  • {
  • pst3_a = ((Integer)piste3.elementAt(j)).intValue();
  • pst3_b = ((Integer)piste3.elementAt(j+1)).intValue();
  • }
  • for(int j=0;j<piste4.size();j++)
  • {
  • pst4_a = ((Integer)piste4.elementAt(j)).intValue();
  • pst4_b = ((Integer)piste4.elementAt(j+1)).intValue();
  • }
  • g.setColor(Color.blue);
  • //switch(indexPiste)
  • // {
  • // case 1:
  • for(i=0,j=0;(i<count-1)&&(i<longueur);i++,j++)
  • {
  • g.drawLine(t1,pst1_a,t2,pst1_b); // g.drawLine(x1,y1,x2,y2)
  • g.setColor(Color.blue);
  • }
  • // break;
  • // case 2:
  • for( i=0, j=0; (i<count-1)&&(i<longueur); i++, j++)
  • {
  • g.drawLine(t1,pst2_a,t2,pst2_b);
  • g.setColor(Color.blue);
  • }
  • // break;
  • // case 3:
  • for( i=0, j=0; (i<count-1)&&(i<longueur); i++, j++)
  • {
  • g.drawLine(t1,pst3_a,t2,pst3_b);
  • g.setColor(Color.blue);
  • }
  • // break;
  • // case 4:
  • for( i=0, j=0; (i<count-1)&&(i<longueur); i++, j++)
  • {
  • g.drawLine(t1,pst4_a,t2,pst4_b);
  • g.setColor(Color.blue);
  • }
  • // break;
  • // }// fin 2ème switch(indexPiste)
  • case 3: //le cas indexSuite = "suivant";
  • g.clearRect(0,0,largeur,hauteur);
  • g.setColor(couleur);
  • g.fillRect (1, 1, largeur-2, hauteur-2);
  • effacer=false;
  • break;
  • case 4: //le cas indexSuite = "precedent";
  • g.clearRect(0,0,largeur,hauteur);
  • g.setColor(couleur);
  • g.fillRect (1, 1, largeur-2, hauteur-2);
  • effacer=false;
  • break;
  • }// fin 1er switch(indexSuite)
  • g1.setFont(f);
  • //////
  • for(int k=0; k<7; k++)//...????????????
  • {
  • g.drawString(String.valueOf(4*pas*k+depart/20), 40+k*80-5, 495);
  • min=String.valueOf(((520*pas+depart)/20)%60);
  • s=String.valueOf(((520*pas+depart)/20)%60);
  • g.setColor(Color.black);
  • g.drawString(min+"min"+s,458,40);
  • g.setColor(Color.blue);
  • if(longueur-count > 20)
  • {
  • count += 20;
  • depart +=20;
  • }// fin if
  • else
  • {
  • count += longueur-count;
  • depart += longueur-count;
  • //}// fin else
  • effacer=true;
  • }
  • }//fin for
  • g1.drawImage(img,0,0,this);
  • }
  • //**************************************************************************************************************************
  • //**************METHODE UPDATE(GRAPHICS)*****************************************************************************************************
  • //***************************************************************************************************************************
  • public void update(Graphics g1)
  • {
  • paint(g1);
  • }
  • /*******************************************************************************
  • ************METHODE START******************************************************
  • ******************************************************************************/
  • public void start()
  • {
  • if (thread==null)
  • {
  • thread=new Thread(this);
  • thread.start();
  • }
  • }
  • /*******************************************************************************
  • ********************METHODE STOP ***********************************************
  • *******************************************************************************/
  • public void stop()
  • {
  • thread=null;
  • }
  • /****************************************************************************
  • ********************** METHODE RUN ******************************************
  • ****************************************************************************/
  • public void run()
  • {
  • Thread thisThread=Thread.currentThread();
  • while((thread==thisThread)&&(thread!=null))
  • {
  • repaint();
  • try
  • {
  • Thread.sleep(vit);
  • }
  • catch(InterruptedException e)
  • {
  • if(count==longueur)
  • {
  • count=0;
  • }
  • }
  • }
  • }
  • //****************************************************************************************************************
  • //**************** CONVERSION / INVERSION DES BITS LUS (2 A 2 ) ****************************************************
  • //*******************************************************************************************************************
  • /*
  • public void conversion()
  • { int m,n;
  • short tmp, maxi=0,mini=0;
  • URL u = new URL(getDocumentBase(), fichier);
  • flux = u.openStream();
  • Vector f1 = new Vector();
  • Vector f2 = new Vector();
  • DataInputStream data1 = new DataInputStream(flux);
  • //valeur1 = data1.readUnsignedShort();
  • Short wa1 = new Short(valeur);
  • //***************************************************************************************
  • //DataInputStream data2 = new DataInputStream(flux);
  • //valeur2 = data2.readUnsmgnedShort();
  • //Float wa2 = new Float(valeur2);
  • for(m=0;m<f1.size();m+=2)
  • {for(n=0;n<f2.size();n+=2)
  • {
  • f1.set(m,wa1);
  • //f2.set(n,wa2);
  • //f2.elementAt(n)=f1.elementAt(m+1);
  • //f2.elementAt(n+1)=f1.elementAt(m);
  • //Short fs1 = new Short(f1);
  • //Short fs2= new Short(f2);
  • short shf1a = ((short)(f1.elementAt(m)).shortValue());
  • short shf1b = ((short)(f1.elementAt(m+1)).shortValue());
  • short shf2a = ((short)(f2.elementAt(n)).shortValue());
  • short shf2b = ((short)(f2.elementAt(n+1)).shortValue());
  • shf2a=shf1b;
  • shf1a=shf2b;
  • if(maxi<shf1b)
  • {
  • maxi=shf1b;
  • }
  • if((shf1a!=0)&&(mini>shf1a))
  • {
  • mini=shf1a;
  • }
  • }//fin du 1erfor
  • }//fin du 2ème for
  • /*try
  • {
  • f2.exists();
  • }
  • catch{
  • System.out.println("impossible d'ouvrir le fichier f2");
  • }//fin catch
  • }//fin methode void convers()
  • */
  • //******************************************************************************************************************
  • //****************************************************************************************************************
  • //*******************************************************************************************************************
  • //}
  • public class MaTask extends TimerTask
  • {
  • public void run()
  • {
  • thread.run();
  • }
  • }
  • }// fin de la classe Pisteb999
  • //code Pisteb990.html
  • <html>
  • <head>
  • <title> applet</title>
  • </head>
  • <body>
  • <h1>Visualisation: </h1>
  • <applet code="Pisteb999.class" height=500 width=560 align=ABSMIDDLE>ici l'applet
  • </applet>
  • </body>
  • </html>
//package stage2;
   import javax.swing.*;
   import java.awt.geom.*;
   import java.applet.*;
   import java.io.*;
   import java.net.*;
   import java.awt.*;
   import java.awt.event.*;
   import java.util.*;
   import java.awt.BorderLayout;
   import java.lang.*;
   import java.math.*;
   import java.awt.Graphics;
   import java.lang.Object.*;
   import java.util.Timer;


   public class Pisteb990 extends Applet implements  ActionListener, Runnable
   
   
   {
   
   
      Color couleur,couleur1;
      Font f=new Font("TimesRoman", Font.BOLD, 12);
      int indexPiste, indexVitesse,vitesse,indexSuite, depart, count;
      int reste, countb,valeur,pas,hauteur,longueur,largeur,vit, x, i,j, indice_a , indice_b , indice_c , indice_d ,fin;
      int m,n,t1,t2,pst1_a,pst1_b ,pst2_a,pst2_b,pst3_a,pst3_b ,pst4_a,pst4_b;
      short tmp, maxi=0,mini=3000;
      float val1, val2, val3, val4 ;
      float el_1,el_2,el_3,el_4;
      boolean debut, effacer, suivant, precedent;
      int xh[],yh[],xv[],yv[];
      String s, max, min, st,piste,pression,suite,fichier;
     	//int tempsmaxi=3600;
      Thread thread;
      Image img;
      Graphics g;
      TextArea messageBox = new TextArea();
   
      Vector piste1,piste2,piste3,piste4,t, courbe1, courbe2,courbe3,courbe4 ;
   
      URL u ;
   
      InputStream flux;
      DataInputStream data;
      BorderLayout borderLayout2 = new BorderLayout();
      Choice choixFichier = new Choice();
      Choice choixSuite = new Choice();
      Panel p1 = new Panel();
      Choice choixPression = new Choice();
      Scrollbar js2 = new Scrollbar();
      Panel p2 = new Panel();
      BorderLayout borderLayout1 = new BorderLayout();
      Panel p3 = new Panel();
      Button initialiser = new Button();
      Button avancer = new Button();
      Button stop = new Button();
      Button pause = new Button();
      Choice choixVitesse = new Choice();
      Choice choixPiste = new Choice();
      FlowLayout flowLayout1 = new FlowLayout();
   	//Dialog tailleTemps = new Dialog(this,"taille du vector temps = ";true);
   
   //***************************************************************
   //**** METHODE INIT()********************************************
   //***************************************************************
      public void init()
      {
      
      
      
         couleur = new Color(200, 255, 255);
         couleur1= new Color(220,220,220);
         largeur = getSize().width;
         hauteur = getSize().height;
      
         img     = createImage(largeur,hauteur);
         g       = img.getGraphics();
         setBackground(couleur);
      
      ////////////// création du 1er Pannel avec Listes déroulantes //////////////////////////////////////////////
      
         Panel p1 = new Panel();
      
      
         choixVitesse = new Choice();
         choixVitesse.add("Vitesse");
         choixVitesse.add("Lent");
         choixVitesse.add("Moyen");
         choixVitesse.add("Rapide");
         vitesse = choixVitesse.getSelectedIndex();
      
      
         choixPiste  = new Choice();
         choixPiste.add("Piste");
         choixPiste.add("Piste1");
         choixPiste.add("Piste2");
         choixPiste.add("piste3");
         choixPiste.add("piste4");
         piste = choixPiste.getSelectedItem();
      
      
         choixPression = new Choice();
         choixPression.add("Pression");
         choixPression.add("Bar");
         choixPression.add("mm Hg");
         pression  = choixPression.getSelectedItem();
      
      
         choixFichier = new Choice() ;
         choixFichier.add("DA030410");
         choixFichier.addItem("fich1.dat");
         choixFichier.addItem("fich2.dat");
         fichier = choixFichier.getSelectedItem();
      
      
         choixSuite = new Choice();
         choixSuite.add("Suite ?");
         choixSuite.add("effacer");
         choixSuite.add("début");
         choixSuite.add("suivant");
         choixSuite.add("précedent");
         suite  = choixSuite.getSelectedItem();
      
         p1.setBackground(Color.orange);
         p1.setLayout(flowLayout1);
         choixVitesse.setBackground(Color.green);
         choixFichier.setBackground(Color.cyan);
         choixSuite.setBackground(Color.yellow);
         this.setBackground(Color.lightGray);
      
         this.setLayout(borderLayout2);
         this.add(p1, BorderLayout.NORTH);
         p1.add(choixPiste, null);
         p1.add(choixVitesse, null);
         p1.add(choixPression, null);
         p1.add(choixSuite, null);
         p1.add(choixFichier, null);
      
      
      
      
      ////////// création du 2ème  Panel  avec scrollBar , qui doit accueillir le graphe des mesures ////////////////////////
      
         Panel p2 = new Panel();
         Scrollbar js2 = new Scrollbar(Scrollbar.VERTICAL,0,1,0,255);
         this.add(p2,BorderLayout.EAST);
         p2.add(js2,BorderLayout.EAST);
      
      
      
      
      //////// création du 3ème panel avec Boutons de commandes de défilement ///////////////////////////////////////////
      
         Panel p3 = new Panel();
         this.add(p3,BorderLayout.SOUTH);
         p3.setBackground(Color.lightGray);
      
         stop = new Button("STOP");
         stop.setBackground(Color.red);
         stop.setLabel("STOP");
         stop.addActionListener(this);
         p3.add(stop,null);
      
      
         initialiser = new Button("RESET");
         initialiser.setBackground(Color.cyan);
         initialiser.setLabel("RESET");
         initialiser.addActionListener(this);
         p3.add(initialiser,null);
      
         avancer = new Button("START");
         avancer.setBackground(Color.green);
         avancer.setLabel("START");
         avancer.addActionListener(this);
         p3.add(avancer,null);
      
         pause = new Button("PAUSE");
         pause.setBackground(SystemColor.inactiveCaptionText);
         pause.setLabel("PAUSE");
         pause.addActionListener(this);
         p3.add(pause,null);
      
      
         p1.setVisible(true);
         p2.setVisible(true);
         p3.setVisible(true);
      
      
         Vector courbe1 = new Vector();
         Vector courbe2 = new Vector();
         Vector courbe3 = new Vector();
         Vector courbe4 = new Vector();
      
         Vector piste1 = new Vector();
         Vector piste2 = new Vector();
         Vector piste3 = new Vector();
         Vector piste4 = new Vector();
         Vector t      = new Vector(3600);
         Timer timer = new Timer();
         TimerTask task = new MaTask();
      
      
      
         xh=new int[50];
         yh=new int[50];
         xv=new int[50];
         yv=new int[50];
      
         indice_a =0;
         indice_b =0;
         indice_c =0;
         indice_d =0;
      
         xh[0]=40;
         yv[0]=0;
         fin = 0;
         pas=3;
         depart=0;
         count=520*pas;
      
      
         Integer a = new Integer(indice_a) ;
         courbe1.addElement(a);
         Integer b = new Integer(indice_b) ;
         courbe2.addElement(b);
         Integer c = new Integer(indice_c) ;
         courbe3.addElement(c);
         Integer d = new Integer(indice_d) ;
         courbe4.addElement(d);
      
      
      
         debut=true;
         effacer=true;
         reste=0;
         countb=0;
      
      
      
      }
   
   //***************************************************************************************************************************
   //***************************************************************************************************************************
   
   
   
   
   
   
   
   //************************************************************************************************************
   //**** METHODE ACTION PERFORMED(ACTION EVENT E)***************************************************************
   //************************************************************************************************************
   //************************************************************************************************************
   
   
   
   
      public void actionPerformed(ActionEvent e)
      {
      
      
         if((e.getActionCommand()=="RESET"))
         {
            depart=0;
            count=520*pas;
            debut=false;
            effacer=true;
         }// fin 1er if
      
      
         if((e.getActionCommand()=="STOP"))
         {
            effacer=false;
            debut=false;
            this.stop();
         }// fin 2ème if
      
      
      
      
      //**********************************************************************************************************
      
      
      
         if((e.getActionCommand()=="START"))
         {
         //Timer timer = new Timer();
         //TimerTask task = new MaTask();
         //timer.schedule( task, 1000, 500 );
         
            debut=true;
            effacer=true;
         //tt.scheduleAtFixedRate(thread.run(),0,1000) ;
         //ReadBits rb = new ReadBits();
            this.start();
         
         //for(i=1;i<t.size();i++)
            for(i=1;i<=3600;i++)
            {
               float var = i/pas+40;
               Float wt = new Float(var);
               Integer newI = new Integer(i);
               t.set(i,wt);// problème "NULL POINTER EXCEPTION" à l'éxécution de l'applet 
            
               try
               {
                  URL u = new URL(getDocumentBase(), fichier);
                  flux = u.openStream();
                  data = new DataInputStream(flux);
                  valeur=0;
               
                  try
                  {
                  	 // boucle continue
                     while (true)
                     {
                     
                        valeur = data.readUnsignedShort();//  marche  puisque readUnsignedShort retourne "an int value"
                        Float wa = new Float(valeur);
                        reste= countb%4;
                     
                        switch(reste)
                        {
                           case 0 :
                              Integer nexta = new Integer(indice_a++);
                              courbe1.set(indice_a++,wa);
                              break;
                        
                           case 1 :
                              Integer nextb = new Integer(indice_b++);
                              courbe2.set(indice_b++,wa);
                              break;
                        
                           case 2 :
                              Integer nextc = new Integer(indice_c++);
                              courbe3.set(indice_c++,wa);
                              break;
                        
                           case 3 :
                              Integer nextd = new Integer(indice_d++);
                              courbe4.set(indice_d++,wa);
                              break;
                        }// fin switch
                     
                        countb++;
                        break;
                     }//fin while
                  //this.start();
                  }// fin 2ème try
                  
                  
                     catch(EOFException e1)
                     {
                        flux.close();
                     }//fin 2ème catch
               
               }//fin  1er try
               
                  catch(IOException e1)
                  {
                     System.out.println("Erreur --"+e1.toString());
                  }// fin 1er catch
            
               longueur = countb/4;
            
            }//fin 1er for
         
         //****************************************************************************************************************
            for(j=0;j<piste1.size();j++)
            {
            
               float el1 = ((Float)courbe1.elementAt(j)).floatValue();
               val1 = 180-(el1-2000)/5+40 ;
               Float v1 = new Float(val1);
               piste1.addElement(v1);
            }
         
            for(j=0;j<piste2.size();j++)
            {
               float el2 = ((Float)courbe2.elementAt(j)).floatValue();
               val2 = 180-(el2-2000)/5+60 ;
               Float v2 = new Float(val2);
               piste2.addElement(v2);
            }
         
            for(j=0;j<piste3.size();j++)
            {
               float el3 = ((Float)courbe3.elementAt(j)).floatValue();
               val3 = 180-(el3-2000)/5+180 ;
               Float v3 = new Float(val3);
               piste3.addElement(v3);
            }
         
            for(j=0;j<piste4.size();j++)
            {
               float el4 = ((Float)courbe4.elementAt(j)).floatValue();
               val4 = 180-(el4-2000)/5+300 ;
               Float v4 = new Float(val4);
               piste4.addElement(v4);
            }
         
         
         
         
         
         
         
         
         
         
         } //fin de if (getSource()==avancer)
      
      }//fin de actionPerformed()
   
   
   
   
   
   
   /*******************************************************************************
   ************* METHODE PAINT (GRAPHICS G) *****************************************
   *******************************************************************************/
   
   
   
   
      public void paint(Graphics g1)
      {
      
         indexPiste   = choixPiste.getSelectedIndex();
         indexVitesse = choixVitesse.getSelectedIndex();
         indexSuite   = choixSuite.getSelectedIndex();
        //Timer timer = new Timer();
        //TimerTask task = new MaTask();
        //timer.schedule( task, 1000, 500 );
      
         switch(indexVitesse)
         {
            case 1:
               vit=30;
               break;
            case 2:
               vit=100;
               break;
            case 3:
               vit=200;
               break;
            case 0:
               vit=100;
               break;
         }//fin switch(indexVitesse)
      
      
      
      
         switch(indexSuite)
         {
            case 1:// le cas ou indexSuite ="effacer";
            
               g.clearRect(0,0,largeur,hauteur);//efface et réinitialise
               g.setColor(couleur);
            
               g.fillRect (1, 1, largeur-2, hauteur-2);
               g.setColor(couleur1);
            
               for(i=1;((xh[i-1]+20)<560);i++)   //pour graduer l'axe des x
               {
                  xh[i]=xh[i-1]+40;
                  g.drawLine(xh[i],0,xh[i],480);
                //		g.setColor(Color.blue);
                  //g.drawLine(795,497,800,560);      //les extremites des axes: les fléches pour l'axe des x
               //    g.drawLine(795,503,800,560);
               	//g.setColor(Color.red);
               }// fin 1er for
            
            
               for(i=1;((yv[i-1]+20)<560);i++)  // pour  graduer l'axe des y
               {
                  yv[i]=yv[i-1]+40;
                  g.drawLine(40,yv[i],560,yv[i]);
               	//	  g.setColor(Color.blue);
                  g.drawLine(37,5,40,0);             // les extremites des axes: les fléches pour l'axe des y
                  g.drawLine(43,5,40,0);
               // g.setColor(Color.red);
               
               }// fin 2ème for
            
               g.setColor(Color.red);
               g.drawLine(40,480,560,480);   //axe horizontal des x dans le repère
               g.drawLine(40,480,40,0);      // axe vertical des y  dans le repère
               g.drawString("(s)",545,495);
               g.drawString(String.valueOf(pas*2)+"s",90,78);
               g.drawString("200",60,65);
               g.drawLine(80,80,120,80);
               g.drawLine(80,80,120,80);
               effacer = false;
            
               break;
         
         
         
         
            case 2 :	// le cas ou : indexSuite = "debut" ;
            
            //g.clearRect(0,0,largeur,hauteur);
                        //g.setColor(couleur);
            
            	//g.fillRect (1, 1, largeur-2, hauteur-2);
            	//g.setColor(couleur1);
            	//effacer=false;
                         //g.setColor(Color.cyan);
            
               g.drawString("/"+String.valueOf(longueur/1200)+"min"+String.valueOf((longueur/20)%60)+"s",500,40);
            	// -> ???
            
              	//for(int i=0;i<=t.size();i++)
               for(int i=1;i<=3600;i++)
               {
                  t1 = ((Integer)t.elementAt(i)).intValue();//!!!le vector t est vide !!!puisqu'aucun temps ne lui est passé!!!
               //t1 = ((Integer)(timer)).intValue();
                  t2 = ((Integer)t.elementAt(i+1)).intValue();
                  //t2 = ((Integer)(timer)).intValue();
                  messageBox.append("valeur de  t1 = "+t1);
               }
            
               for(int j=0;j<piste1.size();j++)
               {
                  pst1_a = ((Integer)piste1.elementAt(j)).intValue();
                  pst1_b = ((Integer)piste1.elementAt(j+1)).intValue();
               }
            
               for(int j=0;j<piste2.size();j++)
               {
                  pst2_a = ((Integer)piste2.elementAt(j)).intValue();
                  pst2_b = ((Integer)piste2.elementAt(j+1)).intValue();
               }
            
               for(int j=0;j<piste3.size();j++)
               {
                  pst3_a = ((Integer)piste3.elementAt(j)).intValue();
                  pst3_b = ((Integer)piste3.elementAt(j+1)).intValue();
               }
            
               for(int j=0;j<piste4.size();j++)
               {
                  pst4_a = ((Integer)piste4.elementAt(j)).intValue();
                  pst4_b = ((Integer)piste4.elementAt(j+1)).intValue();
               }
            
               g.setColor(Color.blue);
            
            	//switch(indexPiste)
            	  //     {
            	  //    	case 1:
               for(i=0,j=0;(i<count-1)&&(i<longueur);i++,j++)
               {
                  g.drawLine(t1,pst1_a,t2,pst1_b); // g.drawLine(x1,y1,x2,y2)
               
                  g.setColor(Color.blue);
               }
            	   //      break;
             		  // 	case 2:
               for( i=0, j=0; (i<count-1)&&(i<longueur); i++, j++)
               {
                  g.drawLine(t1,pst2_a,t2,pst2_b);
               
                  g.setColor(Color.blue);
               }
            	    //      break;
              		 // 	case 3:
               for( i=0, j=0; (i<count-1)&&(i<longueur); i++, j++)
               {
                  g.drawLine(t1,pst3_a,t2,pst3_b);
               
                  g.setColor(Color.blue);
               }
            			//	break;
            	 		//  case 4:
               for( i=0, j=0; (i<count-1)&&(i<longueur); i++, j++)
               {
                  g.drawLine(t1,pst4_a,t2,pst4_b);
               
                  g.setColor(Color.blue);
               }
            	 		//  break;
            
            		//	}// fin 2ème  switch(indexPiste)
            
            
            
            
            case 3: //le cas indexSuite = "suivant";
               g.clearRect(0,0,largeur,hauteur);
               g.setColor(couleur);
               g.fillRect (1, 1, largeur-2, hauteur-2);
               effacer=false;
               break;
            case 4: //le cas indexSuite = "precedent";
               g.clearRect(0,0,largeur,hauteur);
               g.setColor(couleur);
               g.fillRect (1, 1, largeur-2, hauteur-2);
               effacer=false;
            
               break;
         
         
         
         }// fin 1er switch(indexSuite)
      
      
         g1.setFont(f);
      
      
      
      //////
         for(int k=0; k<7; k++)//...????????????
         {
            g.drawString(String.valueOf(4*pas*k+depart/20), 40+k*80-5, 495);
            min=String.valueOf(((520*pas+depart)/20)%60);
            s=String.valueOf(((520*pas+depart)/20)%60);
            g.setColor(Color.black);
            g.drawString(min+"min"+s,458,40);
            g.setColor(Color.blue);
         
            if(longueur-count > 20)
            {
               count += 20;
               depart +=20;
            }// fin if
            
            
            else
            {
               count += longueur-count;
               depart += longueur-count;
            //}// fin else
            
               effacer=true;
            }
         }//fin for
      
         g1.drawImage(img,0,0,this);
      }
   
   //**************************************************************************************************************************
   //**************METHODE  UPDATE(GRAPHICS)*****************************************************************************************************
   //***************************************************************************************************************************
   
   
      public void update(Graphics g1)
      {
         paint(g1);
      }
   
   
   /*******************************************************************************
   ************METHODE START******************************************************
   ******************************************************************************/
      public void start()
      {
         if (thread==null)
         {
            thread=new Thread(this);
            thread.start();
         }
      }
   /*******************************************************************************
   ********************METHODE STOP ***********************************************
   *******************************************************************************/
      public void stop()
      {
      
      
         thread=null;
      
      }
   /****************************************************************************
   ********************** METHODE RUN ******************************************
   ****************************************************************************/
      public void run()
      {
         Thread thisThread=Thread.currentThread();
         while((thread==thisThread)&&(thread!=null))
         {
            repaint();
            try
            {
               Thread.sleep(vit);
            }
               catch(InterruptedException e)
               {
                  if(count==longueur)
                  {
                     count=0;
                  }
               }
         }
      }
   
   //****************************************************************************************************************
   //**************** CONVERSION / INVERSION   DES BITS LUS (2 A 2 ) ****************************************************
   //*******************************************************************************************************************
   /*
   public void conversion()
   {	int m,n;
   short tmp, maxi=0,mini=0;
   
   URL u = new URL(getDocumentBase(), fichier);
   flux = u.openStream();
   
   Vector f1  = new Vector();
   Vector f2  = new Vector();
   
   DataInputStream data1  = new DataInputStream(flux);
   //valeur1 = data1.readUnsignedShort();
   Short wa1 = new Short(valeur);
   //***************************************************************************************
   			//DataInputStream data2 = new DataInputStream(flux);
   			//valeur2 = data2.readUnsmgnedShort();
   			//Float wa2 = new Float(valeur2);
   
   for(m=0;m<f1.size();m+=2)
   {for(n=0;n<f2.size();n+=2)
   	{
   	f1.set(m,wa1);
   	//f2.set(n,wa2);
   	//f2.elementAt(n)=f1.elementAt(m+1);
   	//f2.elementAt(n+1)=f1.elementAt(m);
   	//Short fs1 = new Short(f1);
   	//Short fs2= new Short(f2);
   	short shf1a = ((short)(f1.elementAt(m)).shortValue());
   	short shf1b = ((short)(f1.elementAt(m+1)).shortValue());
   	short shf2a = ((short)(f2.elementAt(n)).shortValue());
   	short shf2b = ((short)(f2.elementAt(n+1)).shortValue());
   	shf2a=shf1b;
   	shf1a=shf2b;
   	if(maxi<shf1b)
   		{
   		maxi=shf1b;
   		}
   
   	if((shf1a!=0)&&(mini>shf1a))
   		{
   		mini=shf1a;
   		}
   }//fin du 1erfor
   }//fin du 2ème for
   /*try
   {
   f2.exists();
   }
   catch{
   	System.out.println("impossible d'ouvrir le fichier f2");
   }//fin catch
   
   }//fin methode void convers()
   
   
   */
   //******************************************************************************************************************
   //****************************************************************************************************************
   //*******************************************************************************************************************
   
   //}
   
      public class MaTask extends TimerTask
      {
         public void run()
         {
            thread.run();
         }
      }
   }// fin de la classe Pisteb999

//code Pisteb990.html
<html>
  
  <head>
    <title> applet</title>
  </head>
  
  <body>
    <h1>Visualisation: </h1>
    <applet code="Pisteb999.class"  height=500 width=560 align=ABSMIDDLE>ici l'applet
    </applet>
  </body>

</html>







 Sources de la même categorie

Source avec Zip Source avec une capture CRÉER DES GRAPHIQUES : UTILISATION DE JFREECHART par Julien39
EJB3-BEAN ENTITÉ : RELATIONS BIDIRECTIONNELLES par SoftDeath
Source avec Zip Source avec une capture LETMESEE : CAPTURE D'ÉCRAN À INTERVALLE RÉGULIER : UTILISATI... par pyo656
ENVOI D'UNE ARBORESSENCE EN JAVA VERS SERVEUR FTP par moumou95
ENREGISTRER L'ARBORESCENCE D'UN JTREE DANS UN XML AVEC JDOM par coltman

 Sources en rapport avec celle ci

Source avec Zip Source avec une capture CRÉER DES GRAPHIQUES : UTILISATION DE JFREECHART par Julien39
Source avec Zip Source avec une capture EDITEUR DE COURBES par jojolemariole
Source avec Zip APPLET DIAPORAMA AVEC SELECTION DOSSIER PHOTO par mouclare
Source avec Zip Source avec une capture OUTILS STATISTIQUES AVEC REPRÉSENTATION GRAPHIQUE (RÉGRESSIO... par Julien39
Source avec Zip Source avec une capture ANIMATION, THREADS, GRAPHIQUES par raff

Commentaires et avis

Aucun commentaire pour le moment.

 Ajouter un commentaire


Discussions en rapport avec ce code source dans le forum

applet graphique [ par MrNo ] Je cherche des applet graphique java representant un bouton on off jauge compteur de vittesse traçage de courbes cherche API editeur graphique [ par redouane83 ] salut, je cherche un editeur graphique qui resemble a l'applet EditDraw mais en API, si quelqu'un peut m'en proposer un , ou me montrer comment transf Un Applet dans une JFrame ? (demande conseil) [ par Nitro68 ] Bonjour, je dois réaliser une application java qui se présente avec au centre une partie graphique avec des petits points qui devront bouger, et la po Pb interface graphique (applet et jframe ??) [ par Nitro68 ] Bonjour, je dois réaliser une application java qui se présente avec au centre une partie graphique avec des petits points qui devront bouger, et la po JApplet et interface graphique [ par deglingo592003 ] Tout d'abord bonjour à tous. J'ai réaliser deux petite class disctinct une que l'on appelera class A qui gère en gros tout le traitement. la seconde q une exception de castor:The field critere appears twice in the descriptor [ par bassoumbassoum ] salut,j'utilise le castor comme parseur mais lors de l'execution de mon programme une exception que je n'arrive pas a corriger qui est la suivante :or petit problème avec mon applet [ par mohabib84 ] Bonjour tout le monde, Je suis débutante en java et j'ai essayer de travaillé avec les applets car j'ai trouvé sur le net une applet java qui me perme Afficher image dans une applet [ par xheo ] Bonsoir,j'ai developpé une applet qui charge des images apartir un FileChooser mon probleme est comment visualiser les images ? j'ai utilisé une nouve probleme deploiement applet [ par paypay25 ] Bonjour, je suis en stage de programmationet j'ai un souci en deployant mon applet que j'ai codé avec l'aide de JDeveloperGrace à cet outil de develop Résolution de l'écran [ par Skyffer3 ] Bonjour,j'aimerais changer la résolution de mon écran lorsque je fais tourner une application.J'ai donc implémenter ce code :        GraphicsDevice de


Nos sponsors


Sondage...

Comparez les prix

CalendriCode

Septembre 2010
LMMJVSD
  12345
6789101112
13141516171819
20212223242526
27282930   

Consulter la suite du CalendriCode

 
Développement réalisé par Nicolas SOREL (Nix) avec l'aide de : Cyril DURAND et Emmanuel (EBArtSoft), Merci à Vincent pour ses précieux conseils.
CodeS-SourceS.com© Toute reproduction même partielle est interdite sauf accord écrit du Webmaster
CodeS-SourceS.com© est une marque déposée tous droits réservés

Google Coop CodeS-SourceS Google Coop CodeS-SourceS
Temps d'éxécution de la page : 0,608 sec (4)

Nous contacter | Annoncer sur CodeS-SourceS | Mentions légales