JOptionPane : exception bizarre
voila, je voudrait faire un JOptionPane qui m'offre une lite de choix :
Code:
1 2 3 4 5 6 7 8 9 10 11
|
Object[] options = {"choix 1", "choix 2"};
JOptionPane.showInternalOptionDialog(
fenetre,
"entrer un nom",
"titre",
JOptionPane.OK_CANCEL_OPTION,
JOptionPane.PLAIN_MESSAGE,
new ImageIcon(),
options,
options[0]); |
mais à l'execution, j'ai l'exception suivante :
Citation:
JOptionPane: parentComponent does not have a valid parent
Et j'avoue ne pas comprendre. j'ai penser que c'était mon JFrame fenetre qui était mal definis, mais en essayant avec un JOptionPane simple, je n'ai pas de soucis.
Si quelqu'un pouvais m'eclairer sur cette exception bizarre.
Merci