looking for a class

J

Justin

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
 
R

Rhino

Justin said:
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.
 
T

Thomas Kellerer

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
 
I

Ian Wilson

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.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,774
Messages
2,569,599
Members
45,169
Latest member
ArturoOlne
Top