I don't do much Swing programming usually but I got to play with some at work recently. It's been a lot of fun but I've got this annoying little issue.
My app consists of a JFrame that opens up a modal JDialog to show progress of a long running task. When I alt-tab or switch to another window and then switch back to my program, the modal dialog comes to the top of the view but the parent JFrame does not come to the front. The parent JFrame remains behind the window I temporarily switched to while the modal JDialog comes right to the top. I expect to see JFrame come to the top along with the modal dialog.
This does not happen on my Linux/Gnome box, just on the Windows 7 boxes I have run the program on. Does anyone have any tips?
There are no new questions, but there may be new answers.
Joined: Aug 01, 2008
I suspected that your question about constructing the dialog with the frame as the owner was going to lead me to the answer and it did. Thanks Darryl!
In my program, I subclassed JDialog (well actually the Eclipse WindowBuilder plugin did it for me) and didn't notice the constructors of JDialog that take a Frame as an argument.
After placing a call to the JDialog's constructor with the parent frame as an argument in my JDialog subclass's constructor, I got the behavior I expect.