Originally posted by Michael Dunn:
put 4 textfields on a JPanel
add the panel to an optionPane (message or confirm), as the 'object' arguement
when the optionPne closes you extract the values from the 4 textfields
Mr. Dunn is correct, and his way is probably best because you can control the layout of the panel, but you can also simply pass an array of text fields to JOptionPane.
You can even interleave Strings in the array. For example: