P
Philipp
Hello
I have a main window which pops up a modal dialog to ask the user for
some input parameters.
What is the standard or best or cleanest way to get the parameters back
into the main window when the user clicks "OK" in the dialog?
I can think of a few ways:
1) the main window is passed to the dialog at construction. the main
window has a public method which is called from the dialog with the user
values as parameters.
2) the dialog is shown using a static method which returns the
parameters (JOptionPane.showInputDialog() does it that way)
3) the dialog is not dispose() but hidden on "OK" click, and has public
methods to get relevant parameters. So the main windows gets the values
after the dialog is hidden
4) Other methods?
What do you recommend?
Thanks.
Phil
I have a main window which pops up a modal dialog to ask the user for
some input parameters.
What is the standard or best or cleanest way to get the parameters back
into the main window when the user clicks "OK" in the dialog?
I can think of a few ways:
1) the main window is passed to the dialog at construction. the main
window has a public method which is called from the dialog with the user
values as parameters.
2) the dialog is shown using a static method which returns the
parameters (JOptionPane.showInputDialog() does it that way)
3) the dialog is not dispose() but hidden on "OK" click, and has public
methods to get relevant parameters. So the main windows gets the values
after the dialog is hidden
4) Other methods?
What do you recommend?
Thanks.
Phil