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

Multiple COMPONENT_RESIZED events delivered on programmatic resize

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Open
    • Priority: P4
    • Resolution: Unresolved
    • Affects Version/s: 5.0
    • Fix Version/s: None
    • Component/s: client-libs
    • Labels:
    • Subcomponent:
    • CPU:
      x86
    • OS:
      linux

      Description

      FULL PRODUCT VERSION :
      java version "1.5.0_01"
      Java(TM) 2 Runtime Environment, Standard Edition (build 1.5.0_01-b08)
      Java HotSpot(TM) Client VM (build 1.5.0_01-b08, mixed mode, sharing)


      ADDITIONAL OS VERSION INFORMATION :
      Linux 2.6.9-1.681_FC3 #1 Thu Nov 18 15:10:10 EST 2004 i686 i686 i386 GNU/Linux

      EXTRA RELEVANT SYSTEM CONFIGURATION :
      gnome-libs-1.4.1.2.90-44


      A DESCRIPTION OF THE PROBLEM :
      Multiple java.awt.event.ComponentEvent are delivered on programatic resizes of a JFrame on Linux (tested on Fedora Core 3 as described above). Manual resizes appear to generate only one event correctly.

      In Windows environments the behavior is correct, i.e., only one java.awt.event.ComponentEvent is delivered for resizes (tested in Windows XP).

      STEPS TO FOLLOW TO REPRODUCE THE PROBLEM :
      A ComponentListener will receive two ComponentEvents for each setSize call in the source.

      EXPECTED VERSUS ACTUAL BEHAVIOR :
      EXPECTED -
      Only one ComponentEvent should be generated for each setSize call.

      REPRODUCIBILITY :
      This bug can be reproduced always.

      ---------- BEGIN SOURCE ----------
      import java.awt.event.ComponentEvent;
      import java.awt.event.ComponentListener;

      import javax.swing.JFrame;

      public class ComponentListenerLinuxBug extends JFrame {
          public ComponentListenerLinuxBug() {
              setDefaultCloseOperation(DISPOSE_ON_CLOSE);
              
              ComponentListener componentListener = new ComponentListener() {
                  public void componentResized(ComponentEvent e) {
                      System.out.println(e);
                  }

                  public void componentMoved(ComponentEvent e) { }
                  public void componentShown(ComponentEvent e) { }
                  public void componentHidden(ComponentEvent e) { }
              };
              addComponentListener(componentListener);
          }
          
          public static void main(String[] args) {
              ComponentListenerLinuxBug instance = new ComponentListenerLinuxBug();
              instance.setSize(300,300);
              instance.setVisible(true);
              instance.setSize(500,500);
              instance.setSize(800,600);
          }
      }
      ---------- END SOURCE ----------

        Attachments

          Activity

            People

            Assignee:
            dav Andrei Dmitriev (Inactive)
            Reporter:
            dav Andrei Dmitriev (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Dates

              Created:
              Updated:
              Imported:
              Indexed: