Bonjour,
lors de la compilation de mon prg j'ai une erreur suivante,veuillez m'aidez svp
Exception in thread "main" java.lang.Error: Unresolved compilation problem:

at Fenetre.main(Fenetre.java:285)
voilà mon prg:
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
import java.io.File;
import javax.swing.filechooser.FileFilter;
public class ZFileFilter extends FileFilter 
{
 private String extension=".sdz",description="Fichier Ardoise Mazique";
 
 public ZFileFilter(String ext,String descrip)
 {
	 this.extension=ext;
	 this.description=descrip;
 }
 public boolean accept(File file)
 {
	 return(file.isDirectory()|| file.getName().endsWith(this.extension));
 }
 public String getDescription()
 {
	 return this.extension+"-"+this.description;
 }
}
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
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
import java.awt.Color;
import java.io.Serializable;
public class Point implements Serializable 
{
 //Couleur du point
	private Color color=Color.red;
	
	//Taille
	private int size=10;
	
	//position sur l'axe X:initialisé au dehors du conteneur
	private int x=-10;
	
	//Position sur l'axe Y:initialise au dehors du conteneur
	private int y=-10;
	
	//Type de point
	private String type="ROND";
	
	/* Constructeur par défaut */
	public Point()
	{
		
	}
	/* Constructeur avec paramètres 
	*  @param x
	*  @param y
	*  @param size
	*  @param color
	*  @param type
	*/
	public Point(int x,int y,int size,Color color,String type)
	{
		this.size=size;
		this.x=x;
		this.y=y;
		this.color=color;
		this.type=type;
	}
	/**********************************************
	 *           ACCESSEURS
	 **********************************************/
	public Color getColor()
	{
		return color;
	}
	 public void setColor(Color color)
	 {
		 this.color=color;
	 }
	 
	 public int getSize()
	 {
		 return size;
	 }
	 public void setSize(int size)
	 {
		 this.size=size;
	 }
	 
	 public int getX()
	 {
		 return x;
	 }
	 public void setX(int x)
	 {
		 this.x=x;
	 }
	 
	 public int getY()
	 {
		 return y;
	 }
	 public void setY(int y)
	 {
		 this.y=y;
	 }
	 
	 public String getType()
	 {
		 return type;
	 }
	 public void setType(String type)
	 {
		 this.type=type;
	 }
}
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
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
import java.awt.Color;
import java.awt.Graphics;
import java.awt.event.MouseAdapter;
import java.awt.event.MouseEvent;
import java.awt.event.MouseMotionListener;
import java.io.ObjectOutputStream;
import java.util.ArrayList;
import javax.swing.JPanel;

public class DrawPanel extends JPanel
{
 //Couleur du pointer
	private Color pointerColor=Color.red;
	
	//Forme du pointeur
	private String pointerType="CIRCLE";
	
	//Position X du pointeur
	private int posX=-10,oldX=-10;
	
	//Position Y du pointeur
	private int posY=-10,oldY=-10;
	
	//Pour savoir si on doit dessiner ou non
	private boolean erasing=true;
	
	//Taille du pointeur
	private int pointerSize=15;
	
	//Collection de points!
	private ArrayList<Point>points=new ArrayList<Point>();
	
	/* Constructeur */
	public DrawPanel()
	{
		this.addMouseListener(new MouseAdapter()
		{
			public void mousePressed(MouseEvent e)
			{
			points.add(new Point(e.getX()-(pointerSize/2),e.getY()-(pointerSize/2),pointerSize,pointerColor,pointerType));
			repaint();
		   }
	});
		
	this.addMouseMotionListener(new MouseMotionListener()
	{
		public void mouseDragged(MouseEvent e)
		{
			//On récupère les coordonnées de la souris
			//et on enlève la moitié de la taille du pointer pour center le tracé
			points.add(new Point(e.getX()-(pointerSize/2),e.getY()-(pointerSize/2),pointerSize,pointerColor,pointerType));
		    repaint();
		}
		public void mouseMoved(MouseEvent e)
		{ }
	});
	}
	
	/* Vous la connaissez maintenat, celle-là; */
	public void paintComponent(Graphics g)
	{
		g.setColor(Color.white);
		g.fillRect(0,0,this.getWidth(),this.getHeight());
		//Si on doit effacer, on ne passe pas dans le else=> pas de dessin
		if(this.erasing)
		{
			this.erasing=false;
		}
		else
		{
			//On parcourt notre collection de points
			for(Point p:this.points)
			{
				//On récupère la couleur
				g.setColor(p.getColor());
				//Selon le type de point
				if(p.getType().equals("SQUARRE"))
				{
					g.fillRect(p.getX(),p.getY(),p.getSize(),p.getSize());
				}
				else
				{
					g.fillOval(p.getX(),p.getY(),p.getSize(),p.getSize());
				}
			}
		}
	}
	/* Efface le contenu */
	public void erase()
	{
		this.erasing=true;
		this.points=new ArrayList<Point>();
		repaint();
	}
	
	/* Définit la couleur du pointeur 
	 * @param c
	 * */
	public void setPointerColor(Color c)
	{
		this.pointerColor=c;
	}
	
	/* Définit la forme du pointeur
	 * @param str
	 * */
	public void setPointerType(String str)
	{
		this.pointerType=str;
	}
	public ArrayList<Point> getPoints()
	{
		return points;
	}
	public void setPoints(ArrayList<Point>points)
	{
		this.points=points;
		repaint();
	}
}
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
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
import java.awt.BorderLayout;
import java.awt.Color;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import java.awt.event.ItemListener;
import java.awt.event.KeyEvent; 
import java.io.File;
import java.io.FilterInputStream;
import java.io.FileNotFoundException;
import java.io.FileOutputStream;
import java.io.IOException;
import java.io.ObjectInputStream;
import java.io.ObjectOutputStream;
import java.util.ArrayList;

import javax.swing.ImageIcon;
import javax.swing.JButton;
import javax.swing.JFileChooser;
import javax.swing.JComboBox;
import javax.swing.JFrame;
import javax.swing.JLabel;
import javax.swing.JMenu;
import javax.swing.JMenuBar;
import javax.swing.JMenuItem;
import javax.swing.JOptionPane;
import javax.swing.JPanel;
import javax.swing.JToolBar;
import javax.swing.KeyStroke;

	public class Fenetre extends JFrame
	{ 
	 //**************************************
	 //		     LE MENU            *
	 //**************************************
	 private JMenuBar menuBar = new JMenuBar();
	 JMenu 	fichier = new JMenu("Fichier"),
	                 edition = new JMenu("Edition"),
			  forme = new JMenu("Forme du pointeur"),
	                 couleur = new JMenu("Couleur du pointeur");
			
	 

	JMenuItem 	nouveau = new JMenuItem("Effacer"),
			//Nos nouveaux points de menus
			enregistrer=new JMenuItem("Enregistrer"),enregistrerSous=new JMenuItem("EnregisterSous"),
			ouvrir=new JMenuItem("Ouvrir"),quitter = new JMenuItem("Quitter"),
			rond = new JMenuItem("Rond"),carre = new JMenuItem("Carré"),
			bleu = new JMenuItem("Bleu"),rouge = new JMenuItem("Rouge"),
			vert = new JMenuItem("Vert");
			 
	//****************************************
//			LA BARRE D'OUTILS         *
	//****************************************		
	JToolBar toolBar = new JToolBar();		
	JButton square = new JButton(new ImageIcon("images/carrenoir.jpg")),
		         circle = new JButton(new ImageIcon("images/rondnoir.jpg")),
			  red = new JButton(new ImageIcon("images/rougecarre.jpg")),
			  green = new JButton(new ImageIcon("images/vertcarre.jpg")),
			  blue = new JButton(new ImageIcon("images/bleucarre.jpg"));
			
	//***************************************
//			LES ÉCOUTEURS            *
	//***************************************
	private FormeListener fListener = new FormeListener();
	private CouleurListener cListener = new CouleurListener();
			
	//Le JFileChooser
	//ici j'ai crée un répertoire "backup" à la racine de mon projet
	//En le spécifiant dans le constructeur, mon chooser s'ouvrira dans ce répertoire!
	JFileChooser fileChooser=new JFileChooser("backup/");
	//Nos filtres
	ZFileFilter zFiltre=new ZFileFilter();
	ZFileFilter filtre=new ZFileFilter(".amz","Fichier Ardoise Mazique");
	File file;
	
	//Notre zone de dessin
	private DrawPanel drawPanel = new DrawPanel();
			
	public Fenetre()
	{
	 this.setSize(700, 500);
	 this.setLocationRelativeTo(null);
	 this.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
	 
	 //On ajoute nos filtres sur l'objet!
	 this.fileChooser.addChoosableFileFilter(zFiltre);
	 this.fileChooser.addChoosableFileFilter(filtre);
				
	 //On initialise le menu
	 this.initMenu();

	 //Idem pour la barre d'outils
	 this.initToolBar();

	 //On positionne notre zone de dessin
	 this.getContentPane().add(drawPanel, BorderLayout.CENTER);
	 this.setVisible(true);		
	}
			
	/**
	* Initialise le menu
	*/
	private void initMenu()
	{
	 nouveau.addActionListener(new ActionListener()
	 {
	  public void actionPerformed(ActionEvent arg0) 
	  {
	   drawPanel.erase();
	  }			
	 });
				
	 nouveau.setAccelerator(KeyStroke.getKeyStroke(KeyEvent.VK_N, KeyEvent.CTRL_DOWN_MASK));	
	 quitter.addActionListener(new ActionListener()
	 {
	  public void actionPerformed(ActionEvent arg0) 
	  {
	   System.exit(0);
	  }			
	 });

	 quitter.setAccelerator(KeyStroke.getKeyStroke(KeyEvent.VK_W, KeyEvent.CTRL_DOWN_MASK));
	 fichier.add(nouveau);
	 fichier.addSeparator();
	 
	 //On ajoute les nouveau menus!
	 enregistrer.setAccelerator(KeyStroke.getKeyStroke(KeyEvent.VK_S,KeyEvent.CTRL_DOWN_MASK));
	 //On détermine l'action à faire!
	 enregistrer.addActionListener(new ActionListener()
	 {
		 public void actionPerformed(ActionEvent arg0)
		 {
			 ObjectOutputStream oos;
			 //S'il ne s'agit pas du premier enregistrement!
			 if(file!=null)
			 {
				 try
				 {
					 oos=new ObjectOutputStream(new FileOutputStream(file));
					 oos.writeObject(drawPanel.getPoints());
					 oos.close();
				 }
				 catch(FileNotFoundException e)
				 {
					 e.printStackTrace();
				 }
				 catch(IOException e)
				 {
					 e.printStackTrace();
				 }
			 }
			 //Sinon on demande le nom du fichier
			 else
			 {
				 if(fileChooser.showSaveDialog(null)==JFileChooser.APPROVE_OPTION)
				 {
					 fileChooser.getSelectedFile();
					 //Si l'extension est valide
					 if(fileChooser.getFileFilter().accept(file))
					 {
						 try
						 {
							 oos=new ObjectOutputStream(new FileOutputStream(file));
							 oos=writeObject(drawPanel.getPoints());
							 oos.close();
						 }
						 catch(FileNotFoundException e)
						 {
							 e.printStackTrace();
						 }
						 catch(IOException e)
						 {
							 e.printStackTrace();
						 }
					 }
					 else
					 {
						 //Si vous n'avez pas spécifié une extension valide!
						 JOptionPane alert=new JOptionPane();
						 alert.showMessageDialog(null, "Erreur d'extension de fichier!\nVotre sauvegarde a échoué!","Erreur",JOptionPane.ERROR_MESSAGE);
					 }
				 }
			 }
		 }
	 });
	 fichier.add(ouvrir);
	 fichier.addSeparator();
	 
	 fichier.add(quitter);
	 fichier.setMnemonic('F');
				
	 carre.addActionListener(fListener);
	 rond.addActionListener(fListener);
	 forme.add(rond);
	 forme.add(carre);
				
	 rouge.addActionListener(cListener);
	 vert.addActionListener(cListener);
	 bleu.addActionListener(cListener);
	 couleur.add(rouge);
	 couleur.add(vert);
	 couleur.add(bleu);
				
	 edition.setMnemonic('E');
	 edition.add(forme);
	 edition.addSeparator();
	 edition.add(couleur);
				
	 menuBar.add(fichier);
	 menuBar.add(edition);
				
	 this.setJMenuBar(menuBar);
	}
			
	/**
	* Initialise l barre d'outils
	*/
	private void initToolBar()
	{			
	 JPanel panneau = new JPanel();
	 square.addActionListener(fListener);
	 circle.addActionListener(fListener);
	 red.addActionListener(cListener);
	 green.addActionListener(cListener);
	 blue.addActionListener(cListener);
				
	 toolBar.add(square);
	 toolBar.add(circle);	
	 
	 toolBar.addSeparator();
	 toolBar.add(red);
	 toolBar.add(blue);
	 toolBar.add(green);
								
	 this.getContentPane().add(toolBar, BorderLayout.NORTH);
	}
			
	//**************************************
	//ÉCOUTEUR POUR LE CHANGEMENT DE FORME *
	//**************************************
	class FormeListener implements ActionListener
	{
	 public void actionPerformed(ActionEvent e) 
	 {			
	  if(e.getSource().getClass().getName().equals("javax.swing.JMenuItem"))
	  {				
	   if(e.getSource()==carre)drawPanel.setPointerType("SQUARE");
	   else drawPanel.setPointerType("CIRCLE");
	  }
	  else
	  {				
	   if(e.getSource()==square)drawPanel.setPointerType("SQUARE");
	   else drawPanel.setPointerType("CIRCLE");				
	  }
	 }		
	}

	//****************************************
	//ÉCOUTEUR POUR LE CHANGEMENT DE COULEUR *
	//****************************************
	class CouleurListener implements ActionListener
	{
	 public void actionPerformed(ActionEvent e) 
	 {
	  System.out.println(e.getSource().getClass().getName());
	  if(e.getSource().getClass().getName().equals("javax.swing.JMenuItem"))
	  {
	   System.out.println("OK !");
	   if(e.getSource()==vert)drawPanel.setPointerColor(Color.green);
	   else 
	   if(e.getSource()==bleu)drawPanel.setPointerColor(Color.blue);
	   else drawPanel.setPointerColor(Color.red);
	  }
	 
	  else
	  {
	   if(e.getSource()==green)drawPanel.setPointerColor(Color.green);
	   else 
	   if(e.getSource()==blue)drawPanel.setPointerColor(Color.blue);
	   else drawPanel.setPointerColor(Color.red);				
	  }
	 }		
	}
					
	 public static void main(String[] args)
	 {
	  Fenetre fen = new Fenetre();
	 }			
	}