-
Bug
-
Resolution: Won't Fix
-
P4
-
None
-
6, 7, 8, 9
Frame triggers componentMoved and componentResized events when it is restored from iconified state. This is reproducible on Windows platforms starting jdk6. This is not reproducible with jdk5.
To reproduce, run the below code. It shows a Frame in iconified state. Restore it and see for 'Resized', 'Moved' messages in command window.
import java.awt.*;
import java.awt.event.*;
public class FrameEventTest {
public static void main(String[] args) {
Frame f = new Frame();
f.setExtendedState(Frame.ICONIFIED);
f.setSize(200, 200);
f.addComponentListener(new ComponentAdapter() {
public void componentMoved(ComponentEvent event) {
System.out.println("Moved");
}
public void componentResized(ComponentEvent event) {
System.out.println("Resized");
}
});
f.setVisible(true);
}
}
To reproduce, run the below code. It shows a Frame in iconified state. Restore it and see for 'Resized', 'Moved' messages in command window.
import java.awt.*;
import java.awt.event.*;
public class FrameEventTest {
public static void main(String[] args) {
Frame f = new Frame();
f.setExtendedState(Frame.ICONIFIED);
f.setSize(200, 200);
f.addComponentListener(new ComponentAdapter() {
public void componentMoved(ComponentEvent event) {
System.out.println("Moved");
}
public void componentResized(ComponentEvent event) {
System.out.println("Resized");
}
});
f.setVisible(true);
}
}
- relates to
-
JDK-8209035 Awt automated test 'AWT_Events/Automated/CompContTest/ComponentEventTest' fails
- Open
-
JDK-5025858 Resizing a decorated frame triggers componentResized event twice.
- Resolved
-
JDK-8333403 Write a test to check various components events are triggered properly
- Resolved