[JAVA] problème avec 'showInPutDialog'
qwix@netcourrier.com
-
choubaka Messages postés 5535 Date d'inscription Statut Modérateur Dernière intervention -
choubaka Messages postés 5535 Date d'inscription Statut Modérateur Dernière intervention -
Je ne comprends pas j'ai ça:
nom = JOptionPane.showInputDialog("Entrez votre nom") ;
où nom est déclaré en tant qu'attribut de ma classe en String, quand je l'affiche j'ai ça: Joueur@633e5e.
Je ne comprends pas pourquoi?
Si quelqu'un a une idée...
nom = JOptionPane.showInputDialog("Entrez votre nom") ;
où nom est déclaré en tant qu'attribut de ma classe en String, quand je l'affiche j'ai ça: Joueur@633e5e.
Je ne comprends pas pourquoi?
Si quelqu'un a une idée...
2 réponses
-
Bizarre... quand j'essaie ceci ça fonctionne.
package joption;
import javax.swing.*;
public class JOptionTester {
private String nom;
public JOptionTester() {
}
public void test(){
nom = JOptionPane.showInputDialog("Entrez votre nom") ;
System.out.println("Entrée: " + nom);
}
public static void main(String args[]) {
JOptionTester tester = new JOptionTester();
tester.test();
}
}
??? -
vraiment bizarre en effet
bonané hacky !!!!
Choubanimal :
"Le poilu poilant au poil"