I am looking for a class that I can create an option window. It should
be like a JOptionPane, however, I want to be able to add and catch
multiple fields and field values.
thanks
>I am looking for a class that I can create an option window. It should
> be like a JOptionPane, however, I want to be able to add and catch
> multiple fields and field values.
I think you want a JDialog or maybe a JFrame.
--
Rhino
Justin wrote on 26.09.2006 19:18:
> I am looking for a class that I can create an option window. It should
> be like a JOptionPane, however, I want to be able to add and catch
> multiple fields and field values.
>
> thanks
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
Thomas
Ian Wilson - 27 Sep 2006 10:41 GMT
> Justin wrote on 26.09.2006 19:18:
The subject line was rather feeble. I've amended it.
>> I am looking for a class that I can create an option window. It should
>> be like a JOptionPane, however, I want to be able to add and catch
[quoted text clipped - 5 lines]
> 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.