Salut

Je vais droit au but j'ai besoin de permuter entre des boutons créés dans un panel mais je n'arrive pas a le faire.
Je veux les permuter mais seulement ceux qui sont a coté du bouton vide
je vais vous faire voir par exemple :




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
public class BABEL extends JFrame implements  ActionListener{
private JPanel pan1= new JPanel();
 
private JButton buton1=new JButton("1");
private JButton buton2=new JButton("2");
private JButton buton3=new JButton("3");
private JButton buton3=new JButton("");
public BABEL(){
 
	this.setResizable(false);
 
 
	this.setSize(240, 300);
    this.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
    this.setLocationRelativeTo(null);
    pan1.setBackground(Color.BLACK);
pan1.setLayout(new GridLayout(2,2 ,5,5));
 
    pan1.add(buton2);
 
    pan1.add(buton1);
    pan1.add(buton3);
    buton1.addActionListener(this);
    buton2.addActionListener(this);
    buton3.addActionListener(this);
    this.add(pan1);
	this.setVisible(true);
 
 
 
}
 
@Override
public void actionPerformed(ActionEvent e) {
	// TODO Auto-generated method stub
	??????
 
}
}