Re: How to pass back a value from a window




PJava wrote:
If you use JOptionPane.showInputDialog, it will pass back a string
value.

I have a JDialog window, but don't know how to pass back an object
after the window closed.

Please kindly give me some idea!

THANKS!!!

Assuming you have an OK button on your dialog that you are using to
close, in the event listener for the button use
myDialog.setVisible(false);

Then you can read the fields from the dialog, even though it is no
longer displayed, at any time. No need to pass the object, just read
it.
/js

.