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

Cursor indicates drop denied when JList item dropped on MAWT

    Details

    • Type: Bug
    • Status: Closed
    • Priority: P4
    • Resolution: Won't Fix
    • Affects Version/s: 5.0u4
    • Fix Version/s: None
    • Component/s: client-libs
    • Labels:
    • Subcomponent:
    • CPU:
      x86
    • OS:
      solaris_2.5.1

      Description

      OPERATING SYSTEM(S):
      Red Hat Enterprise Linux 3 Update 4 for IA32
      Red Hat Enterprise Linux 4 for IA32

      FULL JDK VERSION(S):
      java version "1.5.0_04"
      Java(TM) 2 Runtime Environment, Standard Edition (build 1.5.0_04-b05)
      Java HotSpot(TM) Client VM (build 1.5.0_04-b05, mixed mode)

      DESCRIPTION:
      Steps to Recreate:

      1. Compile a sample code, DnDTest.java.

      ================================ DnDTest.java =====================================
      import java.awt.BorderLayout;
      import javax.swing.*;

      public class DnDTest {

      public static void main(String[] args) {
      JFrame s1 = new JTextAreaTest("Drag Souce - JTextArea");
      s1.setVisible(true);
      s1.setLocation(100,100);

      JFrame s2 = new JListTest("Drag Source - JList");
      s2.setLocation(100,400);
      s2.setVisible(true);

      JFrame t1 = new JTextAreaTest("Drop Target - JTextArea");
      t1.setLocation(400,100);
      t1.setSize(300, 600);
      t1.setVisible(true);
      }
      }

      class JListTest extends JFrame {
      public JListTest(String str) {
      super(str);
      setSize(300, 300);
      DefaultListModel model = new DefaultListModel();
      for (int i = 0; i < 5; i++) {
      model.addElement("item" + i);
      }
      JList list = new JList();
      list.setModel(model);
      list.setDragEnabled(true);
      getContentPane().add(list, BorderLayout.CENTER);
      }
      }

      class JTextAreaTest extends JFrame {
      public JTextAreaTest(String str) {
      super(str);
      setSize(300, 300);
      JTextArea ta = new JTextArea("TEST_STRING");
      ta.setDragEnabled(true);
      getContentPane().add(ta, BorderLayout.CENTER);
      }
      }
      ===================================================================================

      2. Run DnDTest with Motif Toolkit.
          
          $ AWT_TOOLKIT=MToolkit java DnDTest

         Then the following three windows come up.

           Drag Source - JTextArea
           Drag Source - JList
           Drop Target - JTextArea
           
      3. Drag a string in "Drag Source - JTextArea" window and
        drop onto "Drop Target - JTextArea" window.
         This drag-and-drop works fine.

      4. Drag one of items in "Drag Source - JList" window,
        and drop onto "Drop Target - JTextArea".
         When the item is dragged on the JTextArea, however, the cursor
       indicates "Drop is not allowed" <--- PROBLEM!!
         And the drop is finished, the item is copied in the JTextArea.

      Result
      Cursor indicates drop denied.

      Expected Result
      Cursor should indicate drop allowed.

      Additional Infomation:
      With XAWT, the problem does not occur.

        Attachments

          Activity

            People

            • Assignee:
              denis Denis Fokin (Inactive)
              Reporter:
              dkorbel David Korbel (Inactive)
            • Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:
                Imported:
                Indexed: