Bonjour,

Je cré une applet (morpion), dans une première étape je demande de choisir entre une X ou un O puis après avoir cliquer sur un bouton démarrer je souhaite effacer tout ce que j'ai dans mon panel afin d'afficher autre chose.
Or lorsque je fait ça, ce que je ré-affiche n'apparait pas à la place de ce que j'avais mais plutôt après.

Voici le 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
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
import java.applet.Applet;
import java.awt.*;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import java.awt.event.MouseEvent;
import java.awt.event.MouseListener;
 
public class Morpion extends Applet implements MouseListener {
 
	Panel panelPrincipal, ligneChoixDessin;
	Label choixDessinJ1;
	CheckboxGroup dessinJoueur1;
	Button demarrer;
 
	public void init() {
		this.setSize(500, 500);
		this.panelPrincipal = new Panel();
 
		this.interfaceChoixDessin();
 
		this.add(this.panelPrincipal);
	}
 
	public void interfaceChoixDessin() {
		this.panelPrincipal.setLayout(new GridLayout(3,1));
		this.choixDessinJ1 = new Label("Veuillez choisir un dessin pour le joueur 1 :");
 
		this.ligneChoixDessin = new Panel();
		this.ligneChoixDessin.setLayout(new GridLayout(1,2));
		this.dessinJoueur1 =  new CheckboxGroup();
		this.ligneChoixDessin.add(new Checkbox("X", this.dessinJoueur1, true));
		this.ligneChoixDessin.add(new Checkbox("O", this.dessinJoueur1, false));
 
		ActionListener clicDemarer = new ActionListener() {
			public void actionPerformed(ActionEvent arg0) {
				partie();
			}
		};
		this.demarrer = new Button("Demarrer");
		this.demarrer.addActionListener(clicDemarer);
 
 
		this.panelPrincipal.add(this.choixDessinJ1);
		this.panelPrincipal.add(this.ligneChoixDessin);
		this.panelPrincipal.add(this.demarrer);
	}
 
	Label quiJoue;
	public void partie() {
		this.panelPrincipal.removeAll();
		this.quiJoue = new Label("C'est au joueur 1 de jouer");
 
		this.grilleMorpion = new Grille();
		this.panelPrincipal.add(this.quiJoue, 0);
 
		//this.panelPrincipal.add(this.quiJoue);
 
		//this.panelPrincipal.setComponentZOrder(this.quiJoue, 0);
	}
}
Auriez-vous une solution à mon problème ?

Par avance merci