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

JVM completely locks up when dragging to an app that has a modal dialog showing.

XMLWordPrintable

    • 01
    • x86
    • windows_2000
    • Verified



        Name: wm7046 Date: 02/05/2002


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

        FULL OPERATING SYSTEM VERSION :
        Microsoft Windows 2000 [Version 5.00.2195]



        A DESCRIPTION OF THE PROBLEM :
        in Java 1.4, if any DnD is enabled and a modal dialog is
        shown, the application locks up completely if a drag is
        attempted to the app.

        There is a possibly-related bug, 4403757, but that does not
        mention locking up.

        STEPS TO FOLLOW TO REPRODUCE THE PROBLEM :
        1. create an app that has any DnD-enabled component
        (example: JTree).
        2. show a modal dialog (example:
        JOptionPane.showMessageDialog)
        3. Drag from the windows desktop over the app.


        EXPECTED VERSUS ACTUAL BEHAVIOR :
        expect: no drag allowd
        actual: no drag allowed, but application completely locks
        up. Windows task manager needed to kill it.

        This bug can be reproduced always.

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

        public class TestDrag extends JFrame
        {
            public TestDrag()
            {
                super("Test of DnD bug");
                this.setDefaultCloseOperation(EXIT_ON_CLOSE);

                JMenuBar menuBar = new JMenuBar();
                JMenu menu = new JMenu("test");

                menu.add(new JMenuItem(new AlertAction(this)));

                menuBar.add(menu);
                this.setJMenuBar(menuBar);

                JComponent content = new JTree();
                content.setBackground(Color.white);
                content.setOpaque(true);
                content.setPreferredSize(new Dimension(400,300));
                this.getContentPane().add(content);

                this.pack();
            }
            public static void main(String[] args)
            {
                new TestDrag().show();
            }
            public static class AlertAction extends AbstractAction
            {
                private JFrame frame;
                public AlertAction(JFrame frame)
                {
                    super("Alert...");
                    this.frame = frame;
                }
                public void actionPerformed(ActionEvent e)
                {
                    JOptionPane.showMessageDialog(frame, "Try dragging now.", "Howdy",
                            JOptionPane.INFORMATION_MESSAGE);
                }
            }
        }
        ---------- END SOURCE ----------

        CUSTOMER WORKAROUND :
        none found.
        (Review ID: 139032)
        ======================================================================

              dassunw Das Das (Inactive)
              mmma Marvin Ma (Inactive)
              Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

                Created:
                Updated:
                Resolved:
                Imported:
                Indexed: