Following situation:
I have a JFrame and call JOptionPane.showInputDialog("test"). The modal dialog will be shown.
When I then switch to another open window in Windows (let’s say Firefox) and then return to my Java application (by clicking the tab in the windows task bar or with ALT+TAB) then only the dialog will be shown.
Is it possible to show the main frame behind the dialog when switching to my app?
E.g. Eclipse behaves the desired way when you open the Preferences dialog. Eclipse is SWT, but maybe it’s possible in Swing too!
I don’t know of a way to do this with JOptionPane’s static methods, since you don’t have access to the dialog itself. However, you can probably achieve the same thing by making your own dialog and adding a listener like this: