How do I get my modal JDialogs to always stay on top?
Posted on 2000-05-05
My application has a JFrame which contains internalframes. Each InternalFrame is the parent of a modal JDialog. These modal dialogs work fine (ie. remain on top, can't click on anything else in that application until the modal dialog is closed) until I click on another window(s) on the taskbar and then go back to my application by clicking the icon on the taskbar. The dialog isn't on top anymore, and is hidden behind the other window(s) that I have to minimize in order to get to the dialog. How do I make this dialog always remain on the front of my application, even if I switch to other applications? The code I used to display the dialog from the InternalFrame is:
MyDialog dialog = new MyDialog(this);
I set setModal(true) in the constructor of MyDialog.
Could this be a bug in the Java VM?