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

Resize cursor stays after fast outline-resize of JInternalFrame with JScrollPane

    XMLWordPrintable

Details

    • b64
    • x86
    • windows_xp
    • Verified

    Backports

      Description

        FULL PRODUCT VERSION :
        java version "1.6.0_01"
        Java(TM) SE Runtime Environment (build 1.6.0_01-b06)
        Java HotSpot(TM) Client VM (build 1.6.0_01-b06, mixed mode, sharing)

        ADDITIONAL OS VERSION INFORMATION :
        Microsoft Windows XP [Version 5.1.2600]

        A DESCRIPTION OF THE PROBLEM :
        If you resize a JInternalFrame containing a JScrollPane in a JDesktop with drag mode JDesktopPane.OUTLINE_DRAG_MODE, it often happens, that the resize cursor doesn't go away until you explicitly leave the internal frame with the mouse.
        It doesn't happen in another drag mode and it doesn't happen, if the internal frame doesn't contain a JScrollPane.

        This may be connected with 6408077, 6400007, 6364746, 6382650, but their descriptions don't really show, that it's a duplicate.

        STEPS TO FOLLOW TO REPRODUCE THE PROBLEM :
        It's easiest to reproduce, when you take the lower right corner of the internal frame, make the frame smaller and release the mouse button while you are still moving the mouse. Plus: Move the mouse fast.


        EXPECTED VERSUS ACTUAL BEHAVIOR :
        EXPECTED -
        After resize the cursor should go back to the default cursor.
        ACTUAL -
        The cursor often remains as the resize cursor.

        REPRODUCIBILITY :
        This bug can be reproduced often.

        ---------- BEGIN SOURCE ----------
        public class InternalFrameCursor extends JFrame
        {
            public static void main(String[] args)
            {
                new InternalFrameCursor();
            }
            public InternalFrameCursor()
            {
                JDesktopPane d = new JDesktopPane();
                getContentPane().add(d, BorderLayout.CENTER);

                // Everything is fine without this line
                d.setDragMode(JDesktopPane.OUTLINE_DRAG_MODE);

                // This one has the problem
                JInternalFrame i1 = new MyInternalFrame();
                JPanel p1 = new JPanel();
                p1.setPreferredSize(new Dimension(2000,2000));

                i1.setTitle("1: ScrollPane");
                i1.getContentPane().add(new JScrollPane(p1), BorderLayout.CENTER);
                i1.setBounds(50,50,300,300);

                // This one doesn't have the problem
                JInternalFrame i2 = new MyInternalFrame();
                JPanel p2 = new JPanel();
                p2.setPreferredSize(new Dimension(2000,2000));
                i2.setTitle("2: Panel");
                i2.getContentPane().add(p2, BorderLayout.CENTER);
                i2.setBounds(400,400,300,300);

                setSize(800,800);
                d.add(i1);
                d.add(i2);
                setVisible(true);
            }
            private static class MyInternalFrame extends JInternalFrame
            {
                public MyInternalFrame()
                {
                    setResizable(true);
                    setVisible(true);
                }
                public void setCursor(Cursor cursor)
                {
                    // For cursor one the reset is missing
                    System.out.println( "Set " + getTitle() + ": " + cursor );
                    super.setCursor(cursor);
                }
            }
        }
        ---------- END SOURCE ----------

        CUSTOMER SUBMITTED WORKAROUND :
        You could reset the cursor yourself in setBounds(), but then the resize cursor is not shown anymore, if you first stop moving and then release the mouse button.

        Release Regression From : 5.0u11
        The above release value was the last known release where this
        bug was not reproducible. Since then there has been a regression.

        Release Regression From : 5.0u11
        The above release value was the last known release where this
        bug was not reproducible. Since then there has been a regression.

        Attachments

          Issue Links

            Activity

              People

                malenkov Sergey Malenkov (Inactive)
                ryeung Roger Yeung (Inactive)
                Votes:
                0 Vote for this issue
                Watchers:
                0 Start watching this issue

                Dates

                  Created:
                  Updated:
                  Resolved:
                  Imported:
                  Indexed: