Explorer Listener
Hi,
I have an applet running inside default browser, how i can understand that the browser is minimized to the taskbar (or maximized) ?
Message was edited by:
acartamersoy
Hi,
I have an applet running inside default browser, how i can understand that the browser is minimized to the taskbar (or maximized) ?
Message was edited by:
acartamersoy
You can't, generally.
You can get the parent Frame of the applet with one of the SwingUtilities methods, and add a window listener to it. That will give activated/deactivated events when the applet gains/loses focus, including when minimized/restored if the applet has focus when that happens.
I know of no way to know what the browser is doing otherwise.
At one point in history, the applet's stop method was usable for this purpose. However, that has changed and the stop method no longer is invoked when the browser page that contains the applet is minimized.
See this bug report:
http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=6253159
Javascript, I think only universally has onBlur/onFocus methods.
Specific browsers may have custom choices, but I'm not sure what they are off-hand.
Applet.stop() was also supposed to be for leaving the page... at least initially that's why I remember. Then start if you browse back to the page. I don't believe it does that either anymore. I think stop() and destroy() are both called leaving the page.