G
Guest
Gast
Hi, kann mir jemand sagen was hier falsch ist, irgendwie wir mir der Dialog nicht angezeigt.
Oder wie bekomme ich das anders hin? Hab ein Beispiel von Sun
http://java.sun.com/docs/books/tutorial/uiswing/components/dialog.html
Und das ist doch genau das selbe oder? Der einzige Unterschied ist das die frame und ich null auf rufe, aber ich hab kein Jframe und wenn ich this schreibe meckert java :-/
Code:
Object[] options = {"Yes","No"};
int returnValue = JOptionPane.showOptionDialog(null,
"Löschen?", "Information", JOptionPane.YES_NO_OPTION,
JOptionPane.QUESTION_MESSAGE,
null, options, options[2]);
Oder wie bekomme ich das anders hin? Hab ein Beispiel von Sun
http://java.sun.com/docs/books/tutorial/uiswing/components/dialog.html
Und das ist doch genau das selbe oder? Der einzige Unterschied ist das die frame und ich null auf rufe, aber ich hab kein Jframe und wenn ich this schreibe meckert java :-/
Code:
Object[] options = {"Yes, please",
"No, thanks",
"No eggs, no ham!"};
int n = JOptionPane.showOptionDialog(frame,
"Would you like some green eggs to go "
+ "with that ham?",
"A Silly Question",
JOptionPane.YES_NO_CANCEL_OPTION,
JOptionPane.QUESTION_MESSAGE,
null,
options,
options[2]);