Problème au lancement d'un "snake"

Résolu/Fermé
Lucas61500 Messages postés 2 Date d'inscription jeudi 16 avril 2015 Statut Membre Dernière intervention 16 avril 2015 - Modifié par Lucas61500 le 16/04/2015 à 17:31
Lucas61500 Messages postés 2 Date d'inscription jeudi 16 avril 2015 Statut Membre Dernière intervention 16 avril 2015 - 16 avril 2015 à 17:30
Bonjour, je suis cette année en Term.S et je fais la spécialité ISN. Je dois coder un Snake pour mon projet de fin d'année, mes connaissances en codage se limitant à de l'algorythmique, j'ai décidé de suivre ce tutoriel : https://michel-douez.developpez.com/articles/java/snake/#LVI , tout en apprenant le langage java en parallèle sur OpenClassRoom. Arrivé à l'étape IV, on me propose de tester le programme en regardant simplement l'incrémentation d'un entier. J'obtient cependant des messages d'exceptions bien qu'ayant respecté le tutoriel, voici le message d'erreur complet :
Exception in thread "Thread-1" java.lang.NullPointerException
 at JFenetre$2.run(JFenetre.java:38)
 at java.lang.Thread.run(Unknown Source)
Exception in thread "AWT-EventQueue-0" java.lang.NullPointerException
 at JFenetre$1.paintComponent(JFenetre.java:25)
 at javax.swing.JComponent.paint(Unknown Source)
 at javax.swing.JComponent.paintChildren(Unknown Source)
 at javax.swing.JComponent.paint(Unknown Source)
 at javax.swing.JLayeredPane.paint(Unknown Source)
 at javax.swing.JComponent.paintChildren(Unknown Source)
 at javax.swing.JComponent.paintToOffscreen(Unknown Source)
 at javax.swing.RepaintManager$PaintManager.paintDoubleBuffered(Unknown Source)
 at javax.swing.RepaintManager$PaintManager.paint(Unknown Source)
 at javax.swing.RepaintManager.paint(Unknown Source)
 at javax.swing.JComponent.paint(Unknown Source)
 at java.awt.GraphicsCallback$PaintCallback.run(Unknown Source)
 at sun.awt.SunGraphicsCallback.runOneComponent(Unknown Source)
 at sun.awt.SunGraphicsCallback.runComponents(Unknown Source)
 at java.awt.Container.paint(Unknown Source)
 at java.awt.Window.paint(Unknown Source)
 at javax.swing.RepaintManager$4.run(Unknown Source)
 at javax.swing.RepaintManager$4.run(Unknown Source)
 at java.security.AccessController.doPrivileged(Native Method)
 at java.security.ProtectionDomain$1.doIntersectionPrivilege(Unknown Source)
 at javax.swing.RepaintManager.paintDirtyRegions(Unknown Source)
 at javax.swing.RepaintManager.paintDirtyRegions(Unknown Source)
 at javax.swing.RepaintManager.prePaintDirtyRegions(Unknown Source)
 at javax.swing.RepaintManager.access$1300(Unknown Source)
 at javax.swing.RepaintManager$ProcessingRunnable.run(Unknown Source)
 at java.awt.event.InvocationEvent.dispatch(Unknown Source)
 at java.awt.EventQueue.dispatchEventImpl(Unknown Source)
 at java.awt.EventQueue.access$500(Unknown Source)
 at java.awt.EventQueue$3.run(Unknown Source)
 at java.awt.EventQueue$3.run(Unknown Source)
 at java.security.AccessController.doPrivileged(Native Method)
 at java.security.ProtectionDomain$1.doIntersectionPrivilege(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)
Exception in thread "AWT-EventQueue-0" java.lang.NullPointerException
 at JFenetre$1.paintComponent(JFenetre.java:25)
 at javax.swing.JComponent.paint(Unknown Source)
 at javax.swing.JComponent.paintChildren(Unknown Source)
 at javax.swing.JComponent.paint(Unknown Source)
 at javax.swing.JLayeredPane.paint(Unknown Source)
 at javax.swing.JComponent.paintChildren(Unknown Source)
 at javax.swing.JComponent.paintToOffscreen(Unknown Source)
 at javax.swing.RepaintManager$PaintManager.paintDoubleBuffered(Unknown Source)
 at javax.swing.RepaintManager$PaintManager.paint(Unknown Source)
 at javax.swing.RepaintManager.paint(Unknown Source)
 at javax.swing.JComponent.paint(Unknown Source)
 at java.awt.GraphicsCallback$PaintCallback.run(Unknown Source)
 at sun.awt.SunGraphicsCallback.runOneComponent(Unknown Source)
 at sun.awt.SunGraphicsCallback.runComponents(Unknown Source)
 at java.awt.Container.paint(Unknown Source)
 at java.awt.Window.paint(Unknown Source)
 at javax.swing.RepaintManager$4.run(Unknown Source)
 at javax.swing.RepaintManager$4.run(Unknown Source)
 at java.security.AccessController.doPrivileged(Native Method)
 at java.security.ProtectionDomain$1.doIntersectionPrivilege(Unknown Source)
 at javax.swing.RepaintManager.paintDirtyRegions(Unknown Source)
 at javax.swing.RepaintManager.paintDirtyRegions(Unknown Source)
 at javax.swing.RepaintManager.prePaintDirtyRegions(Unknown Source)
 at javax.swing.RepaintManager.access$1300(Unknown Source)
 at javax.swing.RepaintManager$ProcessingRunnable.run(Unknown Source)
 at java.awt.event.InvocationEvent.dispatch(Unknown Source)
 at java.awt.EventQueue.dispatchEventImpl(Unknown Source)
 at java.awt.EventQueue.access$500(Unknown Source)
 at java.awt.EventQueue$3.run(Unknown Source)
 at java.awt.EventQueue$3.run(Unknown Source)
 at java.security.AccessController.doPrivileged(Native Method)
 at java.security.ProtectionDomain$1.doIntersectionPrivilege(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)


J'en appelle à vous car je suis dépassé à ce niveau... Merci d'avance de votre aide !

1 réponse

Lucas61500 Messages postés 2 Date d'inscription jeudi 16 avril 2015 Statut Membre Dernière intervention 16 avril 2015
16 avril 2015 à 17:30
Trois jours que j'étais bloqué là dessus, et finalement j'avais simplement oublié l'appel d'un constructeur. Désolé du dérangement
0