Bonjour je voudrais pouvoir fermer une boite de dialogue après que l'utilisateur ait cliqué sur le bouton OK ou Annuler :
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
 
public void boiteSaisie()
     {
     System.out.print("Boite Saisie");
     Personne[] choix; 
     choix=new Personne[5]; 
     choix[0] = new Personne("Wayne", "John",LocalDate.of(1907,5,26)); 
     choix[1] = new Personne("McQueen", "Steeve",LocalDate.of(1930,3,24)); 
     choix[2] = new Personne("Lennon", "John",LocalDate.of(1940,10,9)); 
     choix[3] = new Personne("Gibson", "Mel",LocalDate.of(1956,1,3)); 
     choix[4] = new Personne("Willis", "Bruce",LocalDate.of(1955,3,19)); 
 
     Personne choisie; 
 
     choisie=(Personne)JOptionPane.showInputDialog(null, 
     "sélectionner le client","recherche d’un client", 
     JOptionPane.WARNING_MESSAGE,null,choix,choix[1]);
     System.out.println(choisie);
Cette procédure est appelé après le focus sur une fenetre :
Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8
9
10
11
 
  //Evènement focus sur JTextArea txt
 
     txt.addFocusListener(new FocusListener()
     {
			@Override
			public void focusGained(FocusEvent arg0) {
				// TODO Auto-generated method stub
				{System.out.print("boite Saisie action event");
   	         boiteSaisie();
   	       }
Si quelqu'un a une idée MERCI