maxdevis
Legacy Member
http://java.sun.com/docs/books/tutorial/uiswing/components/dialog.html zei:Getting the User's Input from a Dialog
The only form of showXxxDialog that doesn't return an integer is showInputDialog, which returns an Object instead. This Object is generally a String reflecting the user's choice. Here is an example of using showInputDialog to create a dialog that lets the user choose one of three strings:
An input dialog with a combo box
Object[] possibilities = {"ham", "spam", "yam"};
String s = (String)JOptionPane.showInputDialog(
frame,
"Complete the sentence:\n"
+ "\"Green eggs and...\"",
"Customized Dialog",
JOptionPane.PLAIN_MESSAGE,
icon,
possibilities,
"ham");
Ik zou graag een venstertje krijgen zodat de user de dagen van de maand (28,29,30 of 31) kan aanklikken.
ik heb nu dit
int [] aantalDagen = {28,29,30,31};
int dagen = (int)JOptionPane.showInputDialog(frame,
"Hoeveel dagen heeft je maand?",
"Neerslag",
JOptionPane.PLAIN_MESSAGE,
icon,
aantalDagen,
30);
maar eclipse geeft een probleem met frame en icon.
wat moet ik daar dan juist zetten?
alvast bedankt


