Bonjour,
J'ai récemment commencer à programmer une petite interface graphique seulement j'ai une java.lang.NullPointerException que je n'arrive pas a corriger :/

Voici l'erreur complète:

Exception in thread "Thread-1" java.lang.NullPointerException
at Spangler.Panel.Intro(Panel.java:44)
at Spangler.Selection.run(Selection.java:16)

et voici les deux classes problématiques:

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
42
43
44
45
46
47
48
49
50
package Spangler;
 
import java.awt.Graphics;
import javax.swing.JPanel;
import java.awt.Image;
import javax.imageio.ImageIO;
import java.io.File;
import java.io.IOException;
 
public class Panel extends JPanel { 
 
	private Selection Selec;
 
	public Panel()
	{
		Selec = new Selection();
		this.Selec.SetRefpan(this);
		this.Selec.start();
	}
 
 
    public void fond()
    {
 
    	Graphics g =getGraphics();
	    try {
		    Image fond = ImageIO.read(new File("Images/Accueil/fond.jpg"));
		    g.drawImage(fond, 0, 0, this.getWidth(), this.getHeight(), this);
	        } catch (IOException e) {
		        // TODO Auto-generated catch block
		        e.printStackTrace();
	} 
 
    } 
    public void Intro()
    {
    	Graphics g =getGraphics();
		Image intro;
		try {
			intro = ImageIO.read(new File("Images/Intro/Intro.jpg"));
			g.drawImage(intro, 0, 0, this);
		} catch (IOException e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		}			
 
 
 
  }
}
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
package Spangler;
 
 
 
 
 
public class Selection extends Thread {
	private Panel RefPan;
 
	public void SetRefpan(Panel pan)
	{
		this.RefPan = pan;
	}
 
	 @Override
	    public void run(){
 
		 RefPan.Intro();
 
 
 
	    }
 
}
Quelqu'un pourrait m'éclairer sur ce qui déclenche l'erreur ?

Merci d'avance pour votre aide