Applet's dialog not getting focus when switching to window using Alt-Tab

Hi Friends,

I have a web site which contains applet menu. For displaying alerts and confirmation dialogs, I call methods in applet (swing dialogs) from my javacript. The problem is -

whenever the aplication is showing sucj a swing dialog and I switch to some other browser windows using Alt-Tab and when I try to come back to this window using Alt-Tab, it does not show the swing dialog on the top of window. Moreover it does not allow me to do any click on window since amodal dialog is already open for that window. So it gives an impression like the window has got hanged. But the reason being thatmodal dialog is some where else and is not showing on the top of window and that dialog is not automatically coming on the top of window when I come back to this window using Alt-Tab.

Pleaes suggest a solution to this problem.

Thanks.

[883 byte] By [Pushkera] at [2007-11-27 6:54:46]
# 1

It is a common problem.

It is because your modal dialog's parent is not the applet's frame parent

use

//

Container c = applet;

do{

c=c.getParent();

}while(!(c instanceof Frame)&&null!=c)

return c==null?null:(Frame)c

//

to get the parent of applet

then set it as the parent of your modal dialog

good luck

lonelytaoa at 2007-7-12 18:29:54 > top of Java-index,Desktop,Core GUI APIs...