Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-6643769

Applet main windows steals focus on Popup windows which is running Applet.

    XMLWordPrintable

Details

    • b02
    • generic, x86
    • windows, windows_xp, windows_vista
    • Verified

    Backports

      Description

        FULL PRODUCT VERSION :
        1.4.2_06, 1.5.0_06-13, 1.6.0, and 1.6.0_1-3

        ADDITIONAL OS VERSION INFORMATION :
        Windows XP

        A DESCRIPTION OF THE PROBLEM :
        User run the Applet on main page, and then he pop up windows which run Applet also. When the main page is refreshed automatically, the main page steal focus from the pop up windows.

        STEPS TO FOLLOW TO REPRODUCE THE PROBLEM :
        Step to Reproduce:

        1. Launch TestMainApplet.html
        2. Click link “Test Popup with Applet” and focus this windows.
        3. Wait 5 seconds.

        Note: From step 2, if you click with “Test Popup without Applet”, you cannot replicate problem since 1.5.0.



        EXPECTED VERSUS ACTUAL BEHAVIOR :
        EXPECTED -
        Whenever TestMainApplet.html is refreshed, the “Test Popup with Applet” window is still focused.
        ACTUAL -
        Whenever TestMainApplet.html is refreshed, the “Main Test Refresh” window is focused back.

        REPRODUCIBILITY :
        This bug can be reproduced always.

        ---------- BEGIN SOURCE ----------
        //Source code HelloWorldApplet.java:

        import java.applet.*;
        import java.awt.*;
          
        public class HelloWorldApplet extends Applet
        {
             public void init()
             {
             }
          
             public void stop()
             {
             }

             public void paint(Graphics g)
             {
              g.drawString("Hell World",20,20);
             }

        }

        //Source code HelloWorldApplet2.java:

        import java.applet.*;
        import java.awt.*;
          
        public class HelloWorldApplet2 extends Applet
        {
             public void init()
             {
             }
          
             public void stop()
             {
             }

             public void paint(Graphics g)
             {
              g.drawString("Hell World2",0,20);
             }

        }

        //Source code TestMainApplet.html
        <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
        <HTML>
        <HEAD>
        <TITLE> Main Test Refresh Applet </TITLE>
        <meta http-equiv="REFRESH" content="5">
        </HEAD>
        <BODY>
        <applet code="HelloWorldApplet.class">
        <param name="cache_archive_ex" value="HelloWorldApplet.jar">
        <param name=initial_focus value="true">
        </applet>
        <a href="TestApplet2.html" target="Test">Test Popup with Applet</a>
        <a href="TestPopupwithoutApplet.html" target="Test">Test Popup without Applet</a>
        </BODY>
        </HTML>
        ////////////////////////

        //Source code TestApplet2.html
        <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
        <HTML>
        <HEAD>
        <TITLE>Test Popup with Applet </TITLE>
        <META NAME="Generator" CONTENT="EditPlus">

        </HEAD>

        <BODY>
        <applet code="HelloWorldApplet2.class">
        <param name="cache_archive_ex" value="HelloWorldApplet.jar">
        </applet>
        </BODY>
        </HTML>
        ///////////////////////////////////


        //Source code TestPopupwithoutApplet.html
        <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
        <HTML>
        <HEAD>
        <TITLE> Test Popup withou Applet </TITLE>
        </HEAD>
        <BODY>
        <p>Popup without Applet</p>
        </BODY>
        </HTML>
        ---------- END SOURCE ----------

        CUSTOMER SUBMITTED WORKAROUND :
        Disable refresh automatically on main page.

        Attachments

          Issue Links

            Activity

              People

                ccheung Calvin Cheung
                dav Andrei Dmitriev (Inactive)
                Votes:
                0 Vote for this issue
                Watchers:
                1 Start watching this issue

                Dates

                  Created:
                  Updated:
                  Resolved:
                  Imported:
                  Indexed: