Window with applet tag gains focus prior to new window browser window

setup a :
1. sample index.html page:
<HTML>
<HEAD>
<script>
var _load=function(){window.open('test.html');};
window.attachEvent("onload", _load);
</script>
</HEAD>
<BODY>
<applet code=Index name=Index width=1 height=1 align=baseline>
</BODY>
</HTML>
2. and child test.html window of the above (opened during onload event)
<HTML>
<HEAD>
<TITLE>1</TITLE>
<script>
var _load=function(){window.focus();};
window.attachEvent("onload", _load);
</script>
</HEAD>
<BODY>
TEST PAGE
</BODY>
</HTML>
when a test.html page is opened focus is temporarily shifted back to the index.html page and
only later back to the test.html page (window.focus()) call in that page sets the focus, not always
suceeds, a further code is required to do a retry)
when the applet is removed from the index.html page, problem goes away, it is if the applet tag
has priority in terms of window focus
byproduct of this is also annoying flicker, (while the focus is shifted between index.html and test.html page)
this problem is only happening with SUN JVM (and I dont know if its a defect or by design)
SUN JVM tested:
Java(TM) Plug-in: Version 1.4.2_03
Using JRE version 1.4.2_03 Java HotSpot(TM) Client VM
suggestions, workarounds? appreciate in advance

tested following matrix of browser/VM
Platform Result:
MS IE and Microsoft (R) VM for Java, 5.0 Release 5.0.0.3810 (with success, no focus problems)
MS IE and Java(TM) Plug-in: Version 1.4.2_03 (focus problems, in the case of
two applets one coded on the
main page the other on the pop-
up window)
Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.4) Gecko/20030624 Netscape/7.1 (ax)
Plug-in: Version 1.4.2_03 Using JRE version 1.4.2_03 Java HotSpot(TM) Client VM
(focus problems, in the case of one applet on
the main page or in the case of two applets
one coded on the main page the other on the
pop-up window)
Please see revised test case source code (to support above configurations, as well inclusion of the second
applet to address discrepency in behaviour between Mozilla and IE (with SUN JVM)
<HTML>
<HEAD>
<script>
String.prototype.contains=function(s){return(this.toLowerCase().indexOf(s.toLowerCase())!=-1);};
var u_n=navigator;
var u_agt=u_n.userAgent.toLowerCase();
var u_MSIE=(u_agt.contains("msie"));
var _load=function(){window.open('test.html');};
if (u_MSIE)
window.attachEvent("onload", _load);
else
window.addEventListener("load", _load, false);
</script>
</HEAD>
<BODY>
<applet code=Index name=Index width=1 height=1 align=baseline>
</BODY>
</HTML>
<HTML>
<HEAD>
<TITLE>1</TITLE>
<script>
String.prototype.contains=function(s){return(this.toLowerCase().indexOf(s.toLowerCase())!=-1);};
var u_n=navigator;
var u_agt=u_n.userAgent.toLowerCase();
var u_MSIE=(u_agt.contains("msie"));
var _load=function(){window.focus();};
if (u_MSIE)
window.attachEvent("onload", _load);
else
window.addEventListener("load", _load, false);
</script>
</HEAD>
<BODY>
TEST PAGE
<applet code=Test name=Test width=1 height=1 align=baseline>
</BODY>
</HTML>
Index.java source code:
public class Index extends Applet {
public synchronized void init() {
public synchronized void start() {
public synchronized void stop(){
public synchronized void destroy(){
Test.java source code:
public class Test extends Applet {
public synchronized void init() {
public synchronized void start() {
public synchronized void stop(){
public synchronized void destroy(){

Similar Messages

  • How to make Safari browser always open a new web page in a new Safari browser window which was clicked from a PDF document URL

    Hi
    I have a web application which would enable users to see a list of PDF document on the web page and when the user select the PDF document, it will be open by a adobe PDF view
    Within the content of the PDF document, it will contact URL links to some other portal web pages which we would like these other web pages to be open in a new browser window, but our testing shows that the new web pages may not always open in a new browser window.
    Could you help to advise how I can enforce that new web pages that are clicked from the PDF document can always be open in a new Safari browser window ?
    Thanks in advance.
    Regards
    Sen Lee 

    Hello,
    In order to change the default reader for PDF files (to not open PDF files with Firefox's internal PDF reader), follow these steps:
    #Go to ''Tools'' > ''Options'' (or ''Firefox'' > ''Options'').
    #In the Options window, select the ''Applications'' tab.
    #In the ''Search'' field, type ''PDF''. You should find ''Portable Document Format (PDF)''.
    #On the right handside you should find an ''Action'' column. Use that to select your favorite PDF reader. In order to view PDF files in Firefox, choose ''Preview in Firefox''.
    Did this fix your problems? Please report back to us!
    Thank you.

  • If I have multiple browser windows open (not tabs, windows) and I close 1 of them, why do ALL browser windows close?

    If I have multiple browser windows open (not tabs, windows) and I close 1 of them, why do ALL browser windows close?

    How are you closing the window?
    Are you using the File menu or the close X on the title bar?
    Use Alt + F to open the File menu with the Close Tab entry visible (doesn't work with the mouse).

  • How to make pack200 work with applet tag ?

    Hello All,
    Sorry for the cross-post.
    I tired getting the advise on java.net forum but with no success. Can someone here please help with this or direct me to right direction.
    I am trying to use the pack200 compressed jars for my Object/Applet tag, but not sure how to go about using it.
    I have followed the instructions for jarsigned pack200 jars.
    http://java.sun.com/j2se/1.5.0/docs/guide/deployme.../deployment-guide/pack200.html
    But now how do i use them in my Object tag, what should i name the files in my cache_archive parameter :
    example:
    something like :
    <PARAM NAME = CACHE_ARCHIVE VALUE = "final.jar" />
    or :
    <PARAM NAME = CACHE_ARCHIVE VALUE = "final.jar.pack.gz" />
    renaming : final.jar.pack.gz --> final.jar ??
    I tried both the above options but none of them works.
    network: Wrote URL http://myserver.net/Stream/lib/final.jar to File C:\Documents and Settings\I025204\Application Data\Sun\Java\Deployment\cache\6.0\60\366763c-2a096009-temp
    java.util.zip.ZipException: ZIP file must have at least one entry
    at java.util.zip.ZipOutputStream.finish(Unknown Source)
    at java.util.zip.DeflaterOutputStream.close(Unknown Source)
    at java.util.zip.ZipOutputStream.close(Unknown Source)
    at com.sun.deploy.net.HttpDownloadHelper.download(Unknown Source)
    at com.sun.deploy.cache.Cache$1.run(Unknown Source)
    at java.security.AccessController.doPrivileged(Native Method)
    at com.sun.deploy.cache.Cache.downloadResourceToCache(Unknown Source)
    at com.sun.deploy.cache.DeployFileOutputStream.close(Unknown Source)
    at sun.net.www.protocol.http.HttpURLConnection$HttpInputStream.close(Unknown Source)
    at java.io.BufferedInputStream.close(Unknown Source)
    at sun.plugin.PluginURLJarFileCallBack.downloadJAR(Unknown Source)
    at sun.plugin.PluginURLJarFileCallBack.access$000(Unknown Source)
    at sun.plugin.PluginURLJarFileCallBack$1.run(Unknown Source)
    at java.security.AccessController.doPrivileged(Native Method)
    at sun.plugin.PluginURLJarFileCallBack.retrieve(Unknown Source)
    at sun.net.www.protocol.jar.URLJarFile.retrieve(Unknown Source)
    at sun.net.www.protocol.jar.URLJarFile.getJarFile(Unknown Source)
    Do i need to add something more .
    I am only allowed to use the below:as its the corporate policy for now.
    Java Plug-in 1.6.0_05
    Using JRE version 1.6.0_05 Java HotSpot(TM) Client VM
    Can someone please help me how to get the pack200 work in the Object tag ?
    Please advise.
    Thanks,

    InputStream in = sc.getResourceAsStream("application.jar.pack.gz");
            OutputStream out = response.getOutputStream();
            if (in != null) {
                try {
                    sendOut(in,out);
                } catch (IOException ioe) {
                    if (ioe.getMessage().compareTo("Broken pipe") == 0) {
                        sc.log("Broken Pipe while writing");
                        return;
                    } else  throw ioe;
            } else response.sendError(response.SC_NOT_FOUND);
    private void sendOut(InputStream in, OutputStream ostream)
                     throws IOException {
            byte buf[] = new byte[8192];
    System.out.println("send jar file");
            int n = in.read(buf);
            while (n > 0 ) {System.out.println(n);
                ostream.write(buf,0,n);
                n = in.read(buf);
            ostream.close();
            in.close();
        }the servlet code is above
    u should conifgure the servlet in the web.xml for urlmapping *.jar
    <servlet-mapping>
          <servlet-name>jarService</servlet-name>
          <url-pattern>*.jar</url-pattern>
        </servlet-mapping>where jarService is the name of the pack200 sevice servlet ContentType.java
    Edited by: kartheepanmirra on Jun 17, 2009 12:17 AM
    Edited by: kartheepanmirra on Jun 17, 2009 3:06 AM

  • Giving Stage Focus When First Opening In Browser Window - How??

    Is there any reliable way to give the stage focus when you first open it in a browser window WITHOUT first clicking on the stage? By reliable, I mean something that works across different browsers and on both PCs and Macs.
    I've seen numerous threads on this subject, and I've read the Adobe tech note, and it seems there is no reliable way. This is a joke, right???? How in the world can Adobe ask people to use Flash and not provide a reliable way to give the stage focus on startup. Requiring the user to click on the stage first is totally stupid.
    Has this problem been solved since all the other threads were posted, and if so, what's the solution?
    Thanks.

    for online swfs, it's a security issue and there's no reliable way to do it.  for local files, it's straight-forward.

  • Firefox opens blank windows, plus a normal window with my previous sessions, whenever I start (Firefox 6 on Windows XP) so how do I make it stop doing that?

    Since upgrading to Firefox 6 my Windows XP computer opens about 40 blank Firefox windows whenever I start or restart Firefox. I get my previous session (a single window with multiple tabs) but also these 40+ blank windows that I have to close. So I close them all, restart, and get same thing.

    Restore the default home page
    * https://support.mozilla.com/en-US/kb/How%20to%20set%20the%20home%20page#w_restore-the-default-home-page
    Check and tell if its working.

  • How do I open a new FireFox browser window to the home page and url filled?

    win 7 64-bit, firefox 5 open new window no url. When I have firefox open and open a new browser window, the new window does not open on the home page and no url is present in the address field. If I click on the favicon in the address field, the url of the current page will automatically fill in. The forward and backward arrow buttons remain disabled. In addition, links opened in a new window cause a new browser window to open, but the linked to website is not displayed in the new windows. What is displayed is a new window completely blank with no url in the address bar. I tried to include troubleshooting information by clicking on the copy to clipboard, but apparently the character count was exceeded.

    I disabled all plug-ins and extensions. the problem has been resolved. Now I will enable each one individually to find out which one was the offender.

  • How to open a swf file in a new NON-browser window

    Hi, I'm trying to create a page where you click on the video thumbnail and the video opens up in its own window. I'd like the video to open at a specific size that I determine, not the browser, and I want it to be scalable. Here is what I have so far as a test file "http://petoweb.com/telos/TelosPlayerTEST.html"
    Here is what I am trying to emulate "http://www.jonesdaylondon.com/recruitment_videos/" (just click any of the videos)
    Any help appreciated. Thanks.

    if you are using AS2
    try GG jsWindow v2 component
    you can open a popup window with no tollbar,statusbar,menubar, and specified width and height of the window.
    download here
    if you are using AS3, or if you know javascript,
    you can also call a javascript command windows.open() from actionscript
    this method only works if you are viewing the swf inside a html loaded from web server.

  • Multitouch zoom in google maps on a windows 7 tablet leads to a zoom of the whole browser window including tools.

    Using a tablet with windows 7 and multitouch screen and the actual firefox version. If i open google maps and want to zoom the map with the zoom gesture, firefox zooms the hole browser window including the tools instead of the map. If i open another empty tab and closing it before using the zooming gesture, everything will work. Would be helpful if someone could give me a hint how to overcome these problems without always opening a new empty tab.

    Well, the touch problem was first observed with Firefox Version 21. The Versions 21 to 23 offers the workaround with opening and closing a new tab. Since Version 24 also the workaround didn't work anymore and the problem, that the multitouch gestures zooms the hole browser window is still present. Maybe this makes it clear for now. So would be helpful if anybody could give me a real hint how to overcome these problem.

  • Netscape crash when close window with applet

    I am using JDK1.1 and swingall for load JApplets in Netscape without plugin. Sometimes when I close the window where the applet is, netscape crashes.
    I read that could be a problem of memory when the destroy method is called. Can be other reasons, and if it is a problem of memory how can I avoid it ?
    Thanks,

    Try using Netscape v6.0. Earlier versions have already reported having problems with Java Applets. Hope this would help.
    Ashish

  • Html class with applet tag support ?

    Hello,
    I would like to load in a swing application, an html file which contains the tag 'applet'. JEditorPane doesn't support it.
    Anyone know of an another class ?
    Thanks
    Nathalie OBADIA

    If all else fails you can get the source code and look to see how appletviewer is implemented. It probably just calls some internal sun java classes.

  • I have CS6 in a disk and I can't install it,I get a window with my name and asking for a pass word,the window reads like this:set up wants to make changes type PW to allow this.I type my adobe PW and it doesn't work.I am stake in that step.

    What can I do?I can't install CS6 in a disk.I get a window reading:set up wants to make changes type PW to allow this.
    Type my Adobe PW and is not that.This is frustrating!!!!Downloading, Installing, Setting Up

    Hello ozne,
    as a first step please have a look at these "General infos about the Adobe Account"
    https://www.adobe.com/account.html and http://helpx.adobe.com/x-productkb/global/find-serial-number.html.
    Did you purchase your product from these firms like Amazon? If yes, this is not a serial number, only a code with which you can request a serial number from Adobe. Please have a look at http://helpx.adobe.com/x-productkb/global/find-serial-number.html. (Start here: How did you purchase your product?)
    The following part, so I just see at least, ceased to exist on my Adobe website, everything takes place in the link from above. I leave it as an info yet, it might still fit for you. For this purpose, please click your way through to your Adobe Store and find the button "Get Serial Number". Fill in the form and after a while you will get the real serial number.
    Good luck!
    Hans-Günter

  • Minimize button doesnt work with mouse right button after openning a new tab in windows 8.1 with firefox nightly

    I'am using Mozilla firefox nightly version in Windows 8.1 .... after starting the Mozilla all toolbar options, minimize, maximum buttons works fine. but as soon as i open a new tabe the (minimize, maximize, close) options do not work with mouse left button clicking. I have to click taskbar "nightly icon" to minimize or close the browser.

    HI Ashraful_007,
    Currently Nightly is not a supported version and is changing each day, however please also to not be discouraged to try to start Firefox in Safe Mode to make sure it is not an add on as well as file a bug in bugzilla.mozilla.org.

  • I would like to ask you how to fix this problem with firefox 4 final version: I open one firefox browser window and i leave it then i open another new window of firefox and it opens not homepage but the last closed tab. Thank you in advance

    could you please help me with this because it makes me to choose other browser

    Many thanks for your reply, Waka – guess you're right that it's a new add on or bust... I still find it odd that such a common UI feature across mobile browsers is unavailable in FF24 either as an option under settings or as an add-on. Surely, I'm not the only person who finds this puzzling?

  • Firefox just changed and now it won't let me have multiple windows with the same website open--it just maximizes the first window. How do I stop that?

    For instance, I have PC Gamer opened in one window, and when I tried to set a different window to PC Gamer it maximized the first window.

    If you try to open the same URL in more than one tab then you may have the "Switch to tab" feature preventing that.
    Hold down the Alt or Shift key while an entry in the drop down list is highlighted to disable "Switch to tab" and see the URL of all entries instead.
    * Alt + Enter opens the highlighted URL in a new tab.
    * Shift + Enter opens the highlighted URL in the current tab.
    * Cursor Right copies the highlighted URL to the location bar in case you want to edit it.
    *Switch to Tab no more: https://addons.mozilla.org/firefox/addon/switch-to-tab-no-more/

Maybe you are looking for