How to bring all windows to the front in order together?
I have an application (let's call it "MyApp") who's main window contains a JFrame. Under certain User Input (e.g. a menu selection), a JDialog is popped up with modality type set to APPLICATION_MODAL.
When the user clicks on another application (e.g. on the taskbar in Windows) to bring it to the front, it hides MyApp, as you would expect.
The problem comes when the user then clicks on MyApp on the taskbar to bring it to the front again - Currently, only the JDialog is coming to the front and the parent JFrame is only coming to the front when the JDialog is closed.
What I want is for the main JFrame and its JDialog to both come to the front, in the correct order, when the user clicks on MyApp on the taskbar (or anywhere else).
Please could someone tell me how to do this?
Many thanks in advance.