-
Bug
-
Resolution: Fixed
-
P2
-
6u10
I have a frame which contains few components , even i have added windowListener. When the frame is visible. I can see the frame activated event is triggered. When i click on the security warning icon , frame deactivated event is triggered & then frame activated event is triggered. I tried the same scenario with 1.6.0b104 & with 1.6.0_06-p-b04 , in both the place clicking on the security warning dn't triggered any event. Hence its a regression.
Step to reproduced:-
--------------------
1) Run the attached testcase.
2) When the frame is visible, observe the console that frame activated event is triggered .
3) Click on the security warning icon. Observe on the console the frame deactivated & activated event is triggered. If you see the same then the bug is reproduced.
If I've a Frame and a Window having a null owner with Frame as the active window, clicking on the security warning icon of the Window de-activates the Frame.
Reproducible with the below program.
import java.awt.*;
import java.awt.event.*;
public class ActivationBug {
private static int count = 1;
public static void main(String[] args) {
Frame f = new Frame("Test frame");
f.setSize(200, 200);
f.setLocation(100, 100);
f.setLayout(new FlowLayout());
f.add(new Button("Click Me"));
f.addWindowListener(new WindowAdapter() {
public void windowActivated(WindowEvent event) {
System.out.println((count++) + " Frame windowActivated");
}
public void windowDeactivated(WindowEvent event) {
System.out.println((count++) + " Frame windowDeactivated");
}
});
f.setVisible(true);
Window w = new Window((Frame) null);
w.setSize(200, 200);
w.setLocation(200, 200);
w.setLayout(new FlowLayout());
w.add(new Button("Click Me"));
w.addWindowListener(new WindowAdapter() {
public void windowActivated(WindowEvent event) {
System.out.println((count++) + " Window windowActivated");
}
public void windowDeactivated(WindowEvent event) {
System.out.println((count++) + " Window windowDeactivated");
}
});
w.setVisible(true);
}
}
Step to reproduced:-
--------------------
1) Run the attached testcase.
2) When the frame is visible, observe the console that frame activated event is triggered .
3) Click on the security warning icon. Observe on the console the frame deactivated & activated event is triggered. If you see the same then the bug is reproduced.
If I've a Frame and a Window having a null owner with Frame as the active window, clicking on the security warning icon of the Window de-activates the Frame.
Reproducible with the below program.
import java.awt.*;
import java.awt.event.*;
public class ActivationBug {
private static int count = 1;
public static void main(String[] args) {
Frame f = new Frame("Test frame");
f.setSize(200, 200);
f.setLocation(100, 100);
f.setLayout(new FlowLayout());
f.add(new Button("Click Me"));
f.addWindowListener(new WindowAdapter() {
public void windowActivated(WindowEvent event) {
System.out.println((count++) + " Frame windowActivated");
}
public void windowDeactivated(WindowEvent event) {
System.out.println((count++) + " Frame windowDeactivated");
}
});
f.setVisible(true);
Window w = new Window((Frame) null);
w.setSize(200, 200);
w.setLocation(200, 200);
w.setLayout(new FlowLayout());
w.add(new Button("Click Me"));
w.addWindowListener(new WindowAdapter() {
public void windowActivated(WindowEvent event) {
System.out.println((count++) + " Window windowActivated");
}
public void windowDeactivated(WindowEvent event) {
System.out.println((count++) + " Window windowDeactivated");
}
});
w.setVisible(true);
}
}