Thomas said:
Justin wrote on 26.09.2006 19:18:
The subject line was rather feeble. I've amended it.
You can pass a JPanel to a JOptionPane. You are not restricted to String
objects for the "message" parameter. That JPanel can contain multiple
fields and field values
This is true, I've done it, but I learned to be wary of it.
It is worth noting that if you later want to add an InputValidator to
your panel, you'll be better off with a JDialog because you can't apply
setVerifyInputWhenFocusTarget(false) to the "Cancel" button of a
JOptionPane constructed using the static methods like showConfirmDialog.
There are several other things that are hard to do when you have no
instance variable for the dialog and can't get at it's innards.
My conclusion is that use of JOptionPane is best reserved for dialogs
with simple content.