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

Windows L&F: Minimizing a maximized JIF causes the next frame to Maximize

    XMLWordPrintable

Details

    • Bug
    • Resolution: Fixed
    • P3
    • 6
    • 5.0
    • client-libs
    • beta
    • x86
    • windows_xp

    Backports

      Description

        Name: rmT116609 Date: 04/22/2004


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

        ADDITIONAL OS VERSION INFORMATION :
        Windows XP

        A DESCRIPTION OF THE PROBLEM :
        In Windows look and feel, when a JInternal Frame is maximized, and then minimized using the minimize button, the next JInternal Frame (if it is Maximizable) will be maximized.

        STEPS TO FOLLOW TO REPRODUCE THE PROBLEM :
        Steps for reproducing this bug.
        1) Run the following test code.
        2) Maximize frame 2 using maximize button.
        3) Minimize frame 2 using minimize button.
        4) Frame 1 will now be maximized.



        import java.awt.*;
        import java.awt.event.*;
        import javax.swing.*;


        public class TestMdi
        {
            public TestMdi()
            {
                JFrame frame = new JFrame("MDI Test Frame");

                JDesktopPane desktopPane = new JDesktopPane();
                desktopPane.setPreferredSize(new Dimension(400, 300));
                desktopPane.setBackground(Color.GREEN);
                frame.add(desktopPane, BorderLayout.CENTER);

                frame.pack();
                frame.setSize(1000,800);
                frame.setVisible(true);

                JInternalFrame iFrame1 = new JInternalFrame("Child 1 ", true, true, true, true);
                desktopPane.add(iFrame1);
                desktopPane.getDesktopManager().setBoundsForFrame(iFrame1, 0, 0, 200, 300);
                iFrame1.setVisible(true);

                JInternalFrame iFrame2 = new JInternalFrame("Child 2 ", true, true, true, true);
                desktopPane.add(iFrame2);
                desktopPane.getDesktopManager().setBoundsForFrame(iFrame2, 200, 0, 200, 300);
                iFrame2.setVisible(true);

            }

            public static void main(String[] args)
            {
                try
                {
                    String className = "com.sun.java.swing.plaf.windows.WindowsLookAndFeel";
                    UIManager.setLookAndFeel(className);
                }
                catch (Exception e)
                {
                    e.printStackTrace();
                }

                TestMdi frame = new TestMdi();
            }
        }


        I believe this is due to changes made in the WindowsDesktopManager activateFrame method. The method works correctly when a frame is closed, but it should not maximize the next frame when a frame is minimized.

        EXPECTED VERSUS ACTUAL BEHAVIOR :
        EXPECTED -
        When a frame is maximized and then minimized, the next frame should NOT be maximized.
        ACTUAL -
        With two JInternal frames open and at their normal bounds. Frame 2 was maximized and then minimized. Frame 1 became maximized.

        REPRODUCIBILITY :
        This bug can be reproduced always.

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


        public class TestMdi
        {
            public TestMdi()
            {
                JFrame frame = new JFrame("MDI Test Frame");

                JDesktopPane desktopPane = new JDesktopPane();
                desktopPane.setPreferredSize(new Dimension(400, 300));
                desktopPane.setBackground(Color.GREEN);
                frame.add(desktopPane, BorderLayout.CENTER);

                frame.pack();
                frame.setSize(1000,800);
                frame.setVisible(true);

                JInternalFrame iFrame1 = new JInternalFrame("Child 1 ", true, true, true, true);
                desktopPane.add(iFrame1);
                desktopPane.getDesktopManager().setBoundsForFrame(iFrame1, 0, 0, 200, 300);
                iFrame1.setVisible(true);

                JInternalFrame iFrame2 = new JInternalFrame("Child 2 ", true, true, true, true);
                desktopPane.add(iFrame2);
                desktopPane.getDesktopManager().setBoundsForFrame(iFrame2, 200, 0, 200, 300);
                iFrame2.setVisible(true);

            }

            public static void main(String[] args)
            {
                try
                {
                    String className = "com.sun.java.swing.plaf.windows.WindowsLookAndFeel";
                    UIManager.setLookAndFeel(className);
                }
                catch (Exception e)
                {
                    e.printStackTrace();
                }

                TestMdi frame = new TestMdi();
            }
        }
        ---------- END SOURCE ----------
        (Incident Review ID: 255176)
        ======================================================================

        Attachments

          Issue Links

            Activity

              People

                mbronsonsunw Mike Bronson (Inactive)
                rmandalasunw Ranjith Mandala (Inactive)
                Votes:
                0 Vote for this issue
                Watchers:
                0 Start watching this issue

                Dates

                  Created:
                  Updated:
                  Resolved:
                  Imported:
                  Indexed: