JDK-4028751 : Mouse Drag still not working, despite statement to contrary: id 4018262
  • Type: Bug
  • Component: client-libs
  • Sub-Component: java.awt
  • Affected Version: 1.1
  • Priority: P2
  • Status: Closed
  • Resolution: Duplicate
  • OS: windows_95
  • CPU: x86
  • Submitted: 1997-01-29
  • Updated: 1997-02-12
  • Resolved: 1997-02-12
Related Reports
Duplicate :  
Description

Name: mc57594			Date: 01/29/97


MouseDrag events are not being delivered if the mouse moves
outside the bounding window and should do so (otherwise how can one do
drag and drop?). Compile the following 2 classes, run, and start a drag
within the pink label. Then continue the drag until it moves outside of
the label's bounds. You will see in the console window that the drag
event stop comming once the boundary is crossed. This is not correct,
the events should continue to arrive (with location relative the
component where the drag began) until a mouse release event occurs
regardless of mouse position.

>>>>> class one

import java.awt.*;

public class test extends Frame
{
   public test()
   {
      setLayout(null);
      setSize(400, 500);
      MyLabel mylabel = new MyLabel();
      mylabel.setSize(100, 200);
      mylabel.setLocation(10, 20);
      add(mylabel);
      doLayout();
      pack();
      show();
   }

   public Dimension getMinimumSize()
   {
      return(getSize());
   }

   public Dimension getPreferredSize()
   {
      return(getMinimumSize());
   }

   public Dimension getMaximumSize()
   {
      return(getMinimumSize());
   }


   public static void main(String[] argv)
   {
      new test();
   }
}

>>>>> class two

import java.awt.*;
import java.awt.event.*;

public class MyLabel extends Label implements MouseMotionListener
{
   public MyLabel()
   {
      super();
      setBackground(Color.pink);
      setForeground(Color.black);
      addMouseMotionListener(this);
   }

   public Dimension getMinimumSize()
   {
      return(getSize());
   }

   public Dimension getPreferredSize()
   {
      return(getMinimumSize());
   }

   public Dimension getMaximumSize()
   {
      return(getMinimumSize());
   }

   public void mouseDragged(MouseEvent ev)
   {
      System.out.println("MouseDragged: " + ev);
   }

   public void mouseMoved(MouseEvent ev)
   {

   }
}
======================================================================

Comments
WORK AROUND Name: mc57594 Date: 01/29/97 no sane workaround exists to my knowledge ======================================================================
11-06-2004