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

JInternalFrame.DesktopIcon doesnot relocate on JDesktopPane resize.

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Duplicate
    • Icon: P4 P4
    • None
    • 1.4.0
    • client-libs



      Name: sv35042 Date: 10/09/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 :

      RedHat Linux 7.2

      Kernel: 2.4.12

      glibc version: glibc-2.2.4-13


      ADDITIONAL OPERATING SYSTEMS : Windows 2000



      A DESCRIPTION OF THE PROBLEM :
      Resizing of JDesktopPane doesnot reposition the Desktop
      Icons obtained by iconizing the JInternalFrames added to
      the JDesktopPane.

      If the JDesktopPane size is increased, the desktop icons
      are onserved to remain at the same place and hence give
      the user a feeling as though the icons are placed at the
      center.

      If the JDesktopPane size is reduced to cross over the
      desktop icons, the icons are observed to be missing. The
      icons are visible only when the size is brought back to
      original or greater size.


      STEPS TO FOLLOW TO REPRODUCE THE PROBLEM :
      1) Created a JFrame whose contentpane is set to JLabel
      containing an ImageIcon.

      2) JLabel uses BorderLayout.

      3) Added a JDesktopPane as CENTER component for the above
      JLabel.

      4) Added two JInternalFrames to the above JDesktopPane.

      5) Both the JInternalFrames are iconified and hence the
      DesktopIcons can be seen at the bottom.

      6) Shrink the JFrame and observe that the icons are
      missing. The icons are visible only when the JFrame size
      is increased to original or greater size.

      7) Similarly, if the JFrame size is increased, the desktop
      icons are seen to remain at previos position instead of
      following the bottom space of the JDesktopPane.


      EXPECTED VERSUS ACTUAL BEHAVIOR :
      Expected Result:

      The desktop icons should follow the reshaping of the
      JDesktopPane and hence reposition themselves such that
      they always appear at the bottom of the JDesktopPane.

      Actual Result:

       The desktop icons were found to stick to the original
      position where they were placed on iconizing the
      JinternalFrame.


      This bug can be reproduced always.

      ---------- BEGIN SOURCE ----------
      import java.awt.*;
      import java.awt.event.*;
      import javax.swing.*;
      import javax.swing.event.*;

      public class SampleDesktop extends JFrame
      {
          private JDesktopPane desktop;

          /** Creates a new instance of SampleDesktop */
          public SampleDesktop()
          {
              super("Sample Desktop");
              super.setBounds(50,50,300,300);

              desktop = new JDesktopPane();
              JInternalFrame jif1 = new JInternalFrame("frame: 1", true, true, true,
      true);
              jif1.setBounds(10,10,100,100);
              desktop.add(jif1);
              jif1.setVisible(true);

              JInternalFrame jif2 = new JInternalFrame("frame: 2", true, true, true,
      true);
              jif2.setBounds(50,50,100,100);
              desktop.add(jif2);
              jif2.setVisible(true);

              JLabel label = new JLabel();

              label.setLayout(new BorderLayout());

              label.add(desktop, BorderLayout.CENTER);

              setContentPane(label);

              super.setDefaultCloseOperation(DISPOSE_ON_CLOSE);
              setVisible(true);
          }

          /**
           * @param args the command line arguments
           */
          public static void main(String args[])
          {
              new SampleDesktop();
          }
      }


      ---------- END SOURCE ----------
      (Review ID: 146767)
      ======================================================================

            joutwatesunw Joshua Outwater (Inactive)
            svioletsunw Scott Violet (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Resolved:
              Imported:
              Indexed: