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

Applet.isActive() broken in Web Start shipped with 7u2

XMLWordPrintable

    • b22
    • x86
    • windows_7

        FULL PRODUCT VERSION :
        java version "1.7.0_02"
        Java(TM) SE Runtime Environment (build 1.7.0_02-b13)
        Java HotSpot(TM) Client VM (build 22.0-b10, mixed mode, sharing)

        ADDITIONAL OS VERSION INFORMATION :
        Microsoft Windows [Version 6.1.7600]

        A DESCRIPTION OF THE PROBLEM :
        Applet.isActive() always returns false for an Applet started in Web Start

        REGRESSION. Last worked in version 7

        STEPS TO FOLLOW TO REPRODUCE THE PROBLEM :
        The applet below has a label and button. If the button is pressed, the label shows whether the applet is active.

        EXPECTED VERSUS ACTUAL BEHAVIOR :
        EXPECTED -
        The label shows that the applet is active when the button is pressed.
        ACTUAL -
        Running with JRE 7u2 in both cases, with javaws 7u2, isActive() always returns false, with javaws 6u30 isActive() returns true.

        REPRODUCIBILITY :
        This bug can be reproduced always.

        ---------- BEGIN SOURCE ----------
        Test.java
        ---
        package test;
        import java.applet.Applet;
        import java.awt.event.ActionEvent;
        import java.awt.event.ActionListener;
        import javax.swing.JButton;
        import javax.swing.JLabel;

        public class Test extends Applet implements ActionListener {
            JLabel label = new JLabel("?");
            public void init() {
                JButton button = new JButton("active?");
                add(button);
                add(label);
                button.addActionListener(this);
            }
            public void actionPerformed(ActionEvent e) {
                label.setText("Active: " + isActive());
            }
        }
        ---
        Test.jnlp
        ---
        <?xml version="1.0" encoding="UTF-8"?>
        <!DOCTYPE jnlp PUBLIC "-//Sun Microsystems, Inc//DTD JNLP Descriptor 1.6//EN"
         "http://java.sun.com/dtd/JNLP-1.5.dtd">
        <jnlp spec="1.0+" codebase="file:.">
        <information>
        <title>test</title>
        <description>test</description>
        <vendor>me</vendor>
        </information>
        <resources>
        <j2se version="1.6+" />
        <jar href="test.jar" main="true"/>
        </resources>
        <applet-desc
        name="test"
        documentbase="."
        width="400"
        height="90"
        main-class="test.Test"/>
        </jnlp>


        ---------- END SOURCE ----------

        CUSTOMER SUBMITTED WORKAROUND :
        Don't use Applet.isActive()

              henryjen Henry Jen
              webbuggrp Webbug Group
              Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

                Created:
                Updated:
                Resolved:
                Imported:
                Indexed: