Ecouter menu
Résolu
waste
-
waste -
waste -
Bonjour,
Je souhaite ecouter la réponse de choix mais je bloque
String[] choix = {"3", "5", "Libre"};
JOptionPane jop = new JOptionPane();
String nom = (String)jop.showInputDialog(null,
"Quel type de partie !",
"Competition !",
JOptionPane.QUESTION_MESSAGE,
null,
choix,
choix);
Je souhaite ecouter la réponse de choix mais je bloque
String[] choix = {"3", "5", "Libre"};
JOptionPane jop = new JOptionPane();
String nom = (String)jop.showInputDialog(null,
"Quel type de partie !",
"Competition !",
JOptionPane.QUESTION_MESSAGE,
null,
choix,
choix);
3 réponses
-
Qu'est-ce que tu veux dire par "écouter la réponse" ?
Ta variable "nom" récupères déjà le choix sélectionné.
Remarque : il y avait quelques "erreurs" dans ton code, je corrige :
String[] choix = {"3", "5", "Libre"}; String nom = (String) JOptionPane.showInputDialog( null, "Quel type de partie ?", "Compétition", JOptionPane.QUESTION_MESSAGE, null, choix, choix[0] ); System.out.println(nom); -
-