Given such codes:
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");
You can see that it pop up a window with options. However, can I have an JTextField
paralleled with that? So I can get the inputs both from the option
and the text field
.