I have a JFrame and when the user presses a button is displayed an input jdialog. I need the jdialog to be in non-modal mode and once the user presses ok, I want to do some action based on the input. Right now I pass my view as reference in the jdialog, so that when the user presses ok, the jdialog calls a method of the view. Is there a more standardized way to handle this or this is the only way? I need the jdialog to be in NON-modal mode
Thanks
You can pass a
java.lang.Runnable
to be called from the JDialog when the user presses the ok button. In this way you can put the code you want to run inside the Runnable itself.