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

Desktop Icon for JInternalFrame goes behind an existing icon

    XMLWordPrintable

Details

    Description



      Name: sv35042 Date: 10/18/2002


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

      FULL OPERATING SYSTEM VERSION :

      Linux 2.4.12 #2 i686

      A DESCRIPTION OF THE PROBLEM :
      The Location for JInternalFrame's Desktop icon is computed
      only once when the first time the internal frame is being
      iconified. The bounds computed at the first instance will be
      used for subsequent iconifications.

      If i may quote from the java source, i observed that the
      method: inconifyFrame() DefaultDesktopManager.java invokes
      getBoundsForIconOf() only when wasIcon() method returns false.

      Now, this wasIcon() relies on the property
      HAS_BEEN_ICONIFIED_PROPERTY which is set when the
      internalframe is iconified for the first time and this TRUE
      value is used subsequently.

      As a result, if you de-iconify an internalframe and then
      minimize at a later point in time, the icon is placed at the
      previos location without checking if any other icon has
      taken its place in the meantime.

      The net effect is that the latest icon goes behind an
      existing icon.

      STEPS TO FOLLOW TO REPRODUCE THE PROBLEM :
      1. Create a JDesktopPane of a smaller size.
      2. Add 2 internalframes to the above JDesktopPane
      3. Resize the desktop pane to so small a size that when the
      internal frames are iconified, they get stacked up one on other.
      4. De-iconify the bottom icon and move the top icon to bottom.
      5. Now, Iconify the previosly de-iconified internal-frame.
      6. This one disappears because the new icon tried to occupy
      previos location which is now occupied by a new icon. So,
      the second icon goes behind the first icon and hence appears
      to have been disappeared.

      EXPECTED VERSUS ACTUAL BEHAVIOR :
      I expect Java to compute the best possible location for each
      iconify action and not only for the first time and keep
      using the same location without worrying if any other icon
      has been positioned at the old location

      REPRODUCIBILITY :
      This bug can be reproduced always.

      CUSTOMER WORKAROUND :
      Extend DefaultDesktopManager.java and overried

      protected boolean wasIcon(JInternalFrame f)

      to always return false. This forces iconifyFrame() method in
      DefaultDesktopManager to always compute the location.
      (Review ID: 159779)
      ======================================================================

      Attachments

        Issue Links

          Activity

            People

              mbronsonsunw Mike Bronson (Inactive)
              svioletsunw Scott Violet (Inactive)
              Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

              Dates

                Created:
                Updated:
                Imported:
                Indexed: