Wednesday, May 10, 2006

JOptionPane Madness

String options[] = new String[]{"yes","no"};
int n = JOptionPane.showOptionDialog(frame,
"Would you like green eggs and ham?",
"A Silly Question",
JOptionPane.YES_NO_OPTION,
JOptionPane.QUESTION_MESSAGE,
null, //don't use a custom Icon
options, //the titles of buttons
options[0]); //default button title

No comments:

Post a Comment