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

ctrl+mouse-press+release-crtl+drag leaves mouse unusable

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: P3 P3
    • 1.4.0
    • 1.2.0, 1.3.0
    • client-libs
    • beta2
    • x86
    • windows_nt, windows_2000



      Name: vi73552 Date: 03/09/99


      This demonstrates a bug in java 1.2 DnD on Windows NT.
      Move the mouse pointer to a tree node, press <Ctrl>,
      press left mouse button, release <Ctrl> but don't release
      the mouse button, start dragging. The cursor will change
      to a 'no-drop' cursor. Now release the mouse button.
      The application will remain unusable (try moving or closing
      the window) until you control-click.

      java full version "JDK-1.2-V"
      //
      import java.awt.*;
      import java.awt.dnd.*;
      import java.awt.datatransfer.*;
      import java.awt.event.*;
      import java.util.*;
      import java.io.*;

      import javax.swing.*;

      class Bug
      {
          static String expl =
          "This demonstrates a bug in java 1.2 DnD on Windows NT.\n"+
          "Move the mouse pointer to a tree node, press <Ctrl>,\n"+
          "press left mouse button, release <Ctrl> but don't release\n"+
          "the mouse button, start dragging. The cursor will change\n"+
          "to a 'no-drop' cursor. Now release the mouse button.\n"+
          "The application will remain unusable (try moving or closing\n"+
          "the window) until you control-click.";

          public static void main(String[] args)
          {
           JFrame frame = new JFrame("Java Bug");
           frame.getContentPane().setLayout(new FlowLayout());
           frame.getContentPane().add(new JTextArea(expl));
           frame.getContentPane().add(new DragTree());
           frame.pack();
           frame.setSize(400, 600);
           frame.show();
          }
      }
      class DragTree extends JTree implements DragGestureListener, DragSourceListener, Transferable
      {
          public static final DataFlavor dataFlavor = new DataFlavor(DragTree.class, "DragTree");

          DragTree()
          {
      DragSource source = DragSource.getDefaultDragSource();
              source.createDefaultDragGestureRecognizer(this, DnDConstants.ACTION_COPY_OR_MOVE, this);
          }
          public void dropActionChanged(DragSourceDragEvent
          dsde){}
          public void dragEnter(DragSourceDragEvent dsde){}
          public void dragOver(DragSourceDragEvent dsde){}
          public void dragGestureChanged(DragSourceDragEvent dsde){}
          public void dragExit(DragSourceEvent dse){}
          public void dragDropEnd(DragSourceDropEvent dsde){}
          public void dragGestureRecognized(DragGestureEvent dge)
          {
              dge.startDrag(null, this, this);
          }
          public DataFlavor[] getTransferDataFlavors()
          {
              DataFlavor[] flavors = new DataFlavor[1];
              
              flavors[0] = dataFlavor;

              return flavors;
          }
          public boolean isDataFlavorSupported(DataFlavor flavor)
          {
              return flavor.equals(dataFlavor);
          }
          public Object getTransferData(DataFlavor flavor)
                  throws UnsupportedFlavorException, IOException
          {
              return "aap";
          }
      }
      (Review ID: 55135)
      ======================================================================

      Name: krT82822 Date: 02/08/2000


      8 Feb 2000 eval1127@eng -- reproducible on NT 4 SP 6a. Key point in the <steps to reproduce> is that CTL must be released PRIOR to starting the drag.

      $ java -version
      java version "1.3.0rc1"
      Java(TM) 2 Runtime Environment, Standard Edition (build 1.3.0rc1-T)
      Java HotSpot(TM) Client VM (build 1.3.0rc1-S, mixed mode)

        Bug ID 4218517 has been closed with status 'duplicate of 4269666'
      However, it's a different bug which is still reproducible with JDK1.3RC1.
      (with Bug 4218517 there's no real deadlock and there's a workaround.)

      Here's the orignal bugreport for 4218517:
      ---------------------------------------------


      This demonstrates a bug in java 1.2 DnD on Windows NT.
      Move the mouse pointer to a tree node, press <Ctrl>,
      press left mouse button, release <Ctrl> but don't release
      the mouse button, start dragging. The cursor will change
      to a 'no-drop' cursor. Now release the mouse button.
      The application will remain unusable (try moving or closing
      the window) until you control-click.

      java full version "JDK-1.2-V"
      //
      import java.awt.*;
      import java.awt.dnd.*;
      import java.awt.datatransfer.*;
      import java.awt.event.*;
      import java.util.*;
      import java.io.*;

      import javax.swing.*;

      class Bug
      {
          static String expl =
          "This demonstrates a bug in java 1.2 DnD on Windows NT.\n"+
          "Move the mouse pointer to a tree node, press <Ctrl>,\n"+
          "press left mouse button, release <Ctrl> but don't release\n"+
          "the mouse button, start dragging. The cursor will change\n"+
          "to a 'no-drop' cursor. Now release the mouse button.\n"+
          "The application will remain unusable (try moving or closing\n"+
          "the window) until you control-click.";

          public static void main(String[] args)
          {
           JFrame frame = new JFrame("Java Bug");
           frame.getContentPane().setLayout(new FlowLayout());
           frame.getContentPane().add(new JTextArea(expl));
           frame.getContentPane().add(new DragTree());
           frame.pack();
           frame.setSize(400, 600);
           frame.show();
          }
      }
      class DragTree extends JTree implements DragGestureListener,
      DragSourceListener, Transferable
      {
          public static final DataFlavor dataFlavor = new DataFlavor
      (DragTree.class, "DragTree");

          DragTree()
          {
      DragSource source = DragSource.getDefaultDragSource();
              source.createDefaultDragGestureRecognizer(this,
      DnDConstants.ACTION_COPY_OR_MOVE, this);
          }
          public void dropActionChanged(DragSourceDragEvent
          dsde){}
          public void dragEnter(DragSourceDragEvent dsde){}
          public void dragOver(DragSourceDragEvent dsde){}
          public void dragGestureChanged(DragSourceDragEvent dsde){}
          public void dragExit(DragSourceEvent dse){}
          public void dragDropEnd(DragSourceDropEvent dsde){}
          public void dragGestureRecognized(DragGestureEvent dge)
          {
              dge.startDrag(null, this, this);
          }
          public DataFlavor[] getTransferDataFlavors()
          {
              DataFlavor[] flavors = new DataFlavor[1];
              
              flavors[0] = dataFlavor;

              return flavors;
          }
          public boolean isDataFlavorSupported(DataFlavor flavor)
          {
              return flavor.equals(dataFlavor);
          }
          public Object getTransferData(DataFlavor flavor)
                  throws UnsupportedFlavorException, IOException
          {
              return "aap";
          }
      }
      (Review ID: 100961)
      ======================================================================

            dassunw Das Das (Inactive)
            vasya Vassili Igouchkine (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Resolved:
              Imported:
              Indexed: