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

Frame triggers componentResized on being restored from iconified state

XMLWordPrintable

    • beta2
    • x86
    • windows_98
    • Verified

      On the windows platform, when a Frame is restored from the iconified state, it triggers componentResized on a component listener that has been added to it. This does not happen when tested on Solaris 8. This bug is occuring since Merlin build 59. When the code below is run, this error can be seen :

      file ComponentResizedTest.java

      import java.awt.event.*;
      import java.awt.*;


      public class ComponentResizedTest extends Frame{

          public ComponentResizedTest(){
              super();

              this.setSize(300,300);
      this.setVisible(true);

              this.addComponentListener(new ComponentAdapter(){
                  public void componentResized(ComponentEvent ce){
                      System.out.println("Component Resized takes place when the frame is restored : " + ce);
                  }
              });
              this.addWindowListener(new WindowAdapter(){
                  public void windowClosing(WindowEvent we){
                      System.exit(0);
                  }
              });


              this.setExtendedState(Frame.ICONIFIED);
              try {
                  Thread.currentThread().sleep(500);
              }catch (Exception e){
                  e.printStackTrace();
              }
              this.setExtendedState(Frame.NORMAL);
              try {
                  Thread.currentThread().sleep(500);
              }catch (Exception e){
                  e.printStackTrace();
              }
          }


          public static void main (String [] args){
              new ComponentResizedTest();
          }
      }


      The output can be seen as below:

      C:\work\project>javac ComponentResizedTest.java

      C:\work\project>java -showversion ComponentResizedTest
      java version "1.4.0-beta"
      Java(TM) 2 Runtime Environment, Standard Edition (build 1.4.0-beta-b59)
      Java HotSpot(TM) Client VM (build 1.4.0-beta-b59, mixed mode)

      Component Resized takes place when the frame is restored : java.awt.event.Compon
      entEvent[COMPONENT_RESIZED (0,0 300x300)] on frame0

      C:\work\project>

            rraysunw Richard Ray (Inactive)
            kjethisunw Kanishk Jethi (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Resolved:
              Imported:
              Indexed: