-
Bug
-
Resolution: Fixed
-
P3
-
7
-
b22
-
x86
-
windows_7
Issue | Fix Version | Assignee | Priority | Status | Resolution | Resolved In Build |
---|---|---|---|---|---|---|
JDK-2219802 | 7u4 | Henry Jen | P3 | Closed | Fixed | b07 |
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()
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()
- backported by
-
JDK-2219802 Applet.isActive() broken in Web Start shipped with 7u2
-
- Closed
-