Modal dialog to a JFrame creates problem in windows XP

I have a problem with JDialog(modal) when it is set to a JFrame.

It works when the focus is on the dialog.

If some other application is selected from the taskbar of the windows XP and selecting back the JFrame, the dialog is not poping up on to the frame but it is hided. The dialog can be accessed by selecting Alt+Tab.

Any solution for this.Pl help.

[376 byte] By [PurushothamReddyYBa] at [2007-10-3 9:07:31]
# 1

hi!

you need to create a Short, Self Contained, Compilable and Executable, Example Program that demonstrates the incorrect behaviour, so that any one can easily understand where you are doing a mistake.

And don't forget to use the Code Formatting Tags so the code retains its original formatting.

:)

Aniruddha-Herea at 2007-7-15 4:19:06 > top of Java-index,Desktop,Core GUI APIs...
# 2
Hello, You have to set the parent for JDialog. You have probably set it to null,so this is why you are experiencing this problem.
Toxtera at 2007-7-15 4:19:06 > top of Java-index,Desktop,Core GUI APIs...
# 3
How to set the JInternalFrame as the parent for the JDialog.pl help.
PurushothamReddyYBa at 2007-7-15 4:19:06 > top of Java-index,Desktop,Core GUI APIs...
# 4
Just set the parent to a panel or pane on the Jinternalpaneor set it to yout desktop.rykk
rykk.a at 2007-7-15 4:19:06 > top of Java-index,Desktop,Core GUI APIs...
# 5
Before calling construcotr of JDialog, you can try like this from JInternalFrame:Frame owner = (Frame)SwingUtilities.getWindowAncestor(this);
Toxtera at 2007-7-15 4:19:06 > top of Java-index,Desktop,Core GUI APIs...