IdentifiantMot de passe
Loading...
Mot de passe oublié ?Je m'inscris ! (gratuit)
Navigation

Inscrivez-vous gratuitement
pour pouvoir participer, suivre les réponses en temps réel, voter pour les messages, poser vos propres questions et recevoir la newsletter

Eclipse Java Discussion :

erreurs sous eclipse à l'aide


Sujet :

Eclipse Java

  1. #1
    Futur Membre du Club
    Profil pro
    Inscrit en
    Mai 2008
    Messages
    15
    Détails du profil
    Informations personnelles :
    Localisation : France

    Informations forums :
    Inscription : Mai 2008
    Messages : 15
    Points : 9
    Points
    9
    Par défaut erreurs sous eclipse à l'aide
    Bonjour,
    j'ai une liste d'erreur à l'execution d'un programme et je n'y comprends pas grand chose.
    Pouvez-vous m'aider ?

    voici l'erreur


    Exception in thread "AWT-EventQueue-0" java.lang.IndexOutOfBoundsException: Index: 3, Size: 3
    at java.util.ArrayList.RangeCheck(Unknown Source)
    at java.util.ArrayList.get(Unknown Source)
    at Vect.keyPressed(Vect.java:176)
    at java.awt.Component.processKeyEvent(Unknown Source)
    at java.awt.Component.processEvent(Unknown Source)
    at java.awt.Container.processEvent(Unknown Source)
    at java.awt.Window.processEvent(Unknown Source)
    at java.awt.Component.dispatchEventImpl(Unknown Source)
    at java.awt.Container.dispatchEventImpl(Unknown Source)
    at java.awt.Window.dispatchEventImpl(Unknown Source)
    at java.awt.Component.dispatchEvent(Unknown Source)
    at java.awt.KeyboardFocusManager.redispatchEvent(Unknown Source)
    at java.awt.DefaultKeyboardFocusManager.dispatchKeyEvent(Unknown Source)
    at java.awt.DefaultKeyboardFocusManager.preDispatchKeyEvent(Unknown Source)
    at java.awt.DefaultKeyboardFocusManager.typeAheadAssertions(Unknown Source)
    at java.awt.DefaultKeyboardFocusManager.dispatchEvent(Unknown Source)
    at java.awt.Component.dispatchEventImpl(Unknown Source)
    at java.awt.Container.dispatchEventImpl(Unknown Source)
    at java.awt.Window.dispatchEventImpl(Unknown Source)
    at java.awt.Component.dispatchEvent(Unknown Source)
    at java.awt.EventQueue.dispatchEvent(Unknown Source)
    at java.awt.EventDispatchThread.pumpOneEventForFilters(Unknown Source)
    at java.awt.EventDispatchThread.pumpEventsForFilter(Unknown Source)
    at java.awt.EventDispatchThread.pumpEventsForHierarchy(Unknown Source)
    at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
    at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
    at java.awt.EventDispatchThread.run(Unknown Source)

  2. #2
    Membre averti Avatar de nicotine002
    Profil pro
    Inscrit en
    Décembre 2005
    Messages
    577
    Détails du profil
    Informations personnelles :
    Localisation : France

    Informations forums :
    Inscription : Décembre 2005
    Messages : 577
    Points : 409
    Points
    409
    Par défaut
    Tu as un dépassement d'index au niveau d'un tableau je pense.

    il nous faut ton code pour voir d'où ça vient.

  3. #3
    Futur Membre du Club
    Profil pro
    Inscrit en
    Mai 2008
    Messages
    15
    Détails du profil
    Informations personnelles :
    Localisation : France

    Informations forums :
    Inscription : Mai 2008
    Messages : 15
    Points : 9
    Points
    9
    Par défaut
    C'était bien ça merci !
    J'ai un autre petit problème, voilà un bout de mon code :

    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    if (arg0.getKeyChar()=='W'){
    			this.player.play(stotal);    //puis on lit le morceau
    			System.out.println(stotal);  //le morceau s'affiche sur la console sous forme d'une chaîne de caractères
     
    			try {  	 	  	       		 	
     
     
    					// Ouverture du fichier a ecrire  	 	  	       		 	
    					PrintWriter aEcrire = new PrintWriter(new BufferedWriter(new FileWriter("c:\\partition.txt")));  	 	  	       		 	
                        aEcrire.write(stotal);
    				    aEcrire.close( );  	 	  	       		 	
    				}  	 	  	       		 	
    				catch (IOException e) {   	 	  	       		 	
    					System.out.println("ERREUR"+e);  	 	  	       		 	
    				}  	 	  	       		 	
    			}
    		}
    Et j'obtiens cette erreur :

    ERREURjava.io.FileNotFoundException: c:\partition.txt (Accès refusé)

  4. #4
    Membre averti Avatar de Tux++
    Étudiant
    Inscrit en
    Avril 2008
    Messages
    281
    Détails du profil
    Informations professionnelles :
    Activité : Étudiant

    Informations forums :
    Inscription : Avril 2008
    Messages : 281
    Points : 379
    Points
    379
    Par défaut
    bonjour,


    cela me semble clair...Ton fichier partition.txt t'es réfusé en écriture (ou n'existe pas et tu n'as pas les droits pour le créer)


    vérifie tes droits en écriture sur le fichier

  5. #5
    Futur Membre du Club
    Profil pro
    Inscrit en
    Mai 2008
    Messages
    15
    Détails du profil
    Informations personnelles :
    Localisation : France

    Informations forums :
    Inscription : Mai 2008
    Messages : 15
    Points : 9
    Points
    9
    Par défaut
    excellent merci beaucoup !
    Une dernière question, je voudrais ensuite pouvoir reconvertir ce texte en String.
    voilà ce que j'ai pensé :

    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    20
    21
    22
    23
    24
    25
    26
    27
    28
    29
    30
    31
    32
    33
    34
    35
    36
    37
    38
    39
    40
    41
    try {  	 	  	       		 	
     
    		// Ouverture du fichier a lire   	 	  	       		 	
    		BufferedReader aLire= new BufferedReader(new FileReader(Partition));  	 	  	       		 	
     
    		test=aLire.readLine();
     
     
     
    		do {  	 	  	       		 	
                 if (test!=null) {  	 
    				System.out.println(test);
     
    				int i=0;
    			    String Note;
    				char separateur=' ';
     
    				while ((Partition.charAt(i)!=separateur)&&(Partition.charAt(i+1)!=separateur)){
    					while (Partition.charAt(i)!=separateur)  {
    						Note+=Partition.charAt(i);
    					}
    					    String a;
    					    String b = new String(Partition.charAt(i)[])+new String(Partition.charAt(i+1)[]);
    						String c = new String(Partition.charAt(i+2)[]);
    					    liste.add(Note(b,c,a));
    						i++;
    				}
     
    				for (int j=0;j<=liste.size();j++){
     
    				}
     
     
    		// On ferme les fichiers  	 	  	       		 	
    		aLire.close( );  	 	  	       		 	
     
                 }
     
    	catch (IOException e) {   	 	  	       		 	
    		System.out.println("erreur "+e);  	 	  	       		 	
    	}


    mais ça ne marche pas au niveau des crochets après mon char....

+ Répondre à la discussion
Cette discussion est résolue.

Discussions similaires

  1. Réponses: 2
    Dernier message: 04/12/2012, 18h24
  2. Erreur sous Eclipse : "*.jar has no souce attachement"
    Par DevLib dans le forum Eclipse Java
    Réponses: 1
    Dernier message: 04/08/2011, 11h38
  3. message d'erreur sous eclipse avec jdom
    Par kayenne77 dans le forum XML/XSL et SOAP
    Réponses: 13
    Dernier message: 03/07/2009, 14h11
  4. erreurs sous eclipse
    Par anaaa dans le forum Struts 1
    Réponses: 2
    Dernier message: 17/06/2007, 10h56
  5. Erreur sous eclipse avec Scanner
    Par bugland dans le forum Eclipse Java
    Réponses: 3
    Dernier message: 11/01/2007, 15h28

Partager

Partager
  • Envoyer la discussion sur Viadeo
  • Envoyer la discussion sur Twitter
  • Envoyer la discussion sur Google
  • Envoyer la discussion sur Facebook
  • Envoyer la discussion sur Digg
  • Envoyer la discussion sur Delicious
  • Envoyer la discussion sur MySpace
  • Envoyer la discussion sur Yahoo