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

VM hangs on NT during drop completion

    Details

    • Type: Bug
    • Status: Closed
    • Priority: P2
    • Resolution: Cannot Reproduce
    • Affects Version/s: 1.2.2, 1.3.0
    • Fix Version/s: None
    • Component/s: client-libs
    • Subcomponent:
    • CPU:
      generic, x86
    • OS:
      windows_98, windows_nt

      Description



      Name: rlT66838 Date: 08/10/99


      1. When a drag'n'drop operation completes and the drop end needs to e.g. show a JOptionPane or JDialog or somehow change the focus, the VM hangs.
      (on NT -- Solaris is OK)

      2. Source:

      package com.bluestone.test;

      import java.util.*;
      import java.io.*;
      import java.net.*;
      import java.applet.*;
      import java.awt.*;
      import java.awt.event.*;
      import java.awt.datatransfer.*;
      import java.awt.dnd.*;
      import javax.swing.*;
      import javax.swing.event.*;


      public class TestBed
      {
         protected JFrame m_frame;


         public static void main(String args[])
         {
            new TestBed().run();
         }

         public TestBed()
         {
            m_frame = new JFrame("TestBed");
            m_frame.addWindowListener(new AppWindowListener());
            m_frame.setLocation(100, 100);
            m_frame.setSize(200, 200);
            m_frame.getContentPane().add(new DragLabel("Hey! Drag me!"), BorderLayout.NORTH);
            m_frame.getContentPane().add(new DropText(), BorderLayout.SOUTH);
         }

         public void run()
         {
            m_frame.show();
         }

         public class DragLabel extends JLabel implements DragGestureListener, DragSourceListener
         {
            protected DragSource m_dragSource;
            protected DragGestureRecognizer m_dragGestureRecognizer;


            public DragLabel(String text)
            {
               super(text);
               m_dragSource = DragSource.getDefaultDragSource();
               m_dragGestureRecognizer = m_dragSource.createDefaultDragGestureRecognizer(this, DnDConstants.ACTION_COPY_OR_MOVE, this);
            }

            public void dragGestureRecognized(DragGestureEvent evt)
            {
               evt.startDrag(null, new StringSelection(getText()), this);
            }

            public void dragDropEnd(DragSourceDropEvent evt)
            {
            }

            public void dragEnter(DragSourceDragEvent evt)
            {
            }

            public void dragExit(DragSourceEvent evt)
            {
            }

            public void dragOver(DragSourceDragEvent evt)
            {
            }

            public void dropActionChanged(DragSourceDragEvent evt)
            {
            }
         }

         public class DropText extends JTextField implements DropTargetListener
         {
            protected DropTarget m_dropTarget;


            public DropText()
            {
               super();
               m_dropTarget = new DropTarget(this, this);
            }

            public void dragEnter(DropTargetDragEvent evt)
            {
               evt.acceptDrag(evt.getDropAction());
            }

            public void dragExit(DropTargetEvent evt)
            {
            }

            public void dragOver(DropTargetDragEvent evt)
            {
               evt.acceptDrag(evt.getDropAction());
            }

            public void drop(DropTargetDropEvent evt)
            {
               Transferable transferable;
               String text;


               evt.acceptDrop(evt.getDropAction());
               transferable = evt.getTransferable();
               try
               {
                  text = (String)transferable.getTransferData(DataFlavor.stringFlavor);
                  setText(text);
                  evt.dropComplete(true);
                  JOptionPane.showMessageDialog(m_frame, "Drop: " + getText(), "Drop!", JOptionPane.INFORMATION_MESSAGE);
               }
               catch (UnsupportedFlavorException e)
               {
                  evt.dropComplete(false);
               }
               catch (IOException e)
               {
                  evt.dropComplete(false);
               }
            }

            public void dropActionChanged(DropTargetDragEvent evt)
            {
               evt.acceptDrag(evt.getDropAction());
            }
         }

         public class AppWindowListener extends WindowAdapter
         {
            public void windowClosing(WindowEvent evt)
            {
               m_frame.dispose();
               System.exit(0);
            }
         }
      }

      3. None. The VM hangs immediately.

      4. None.

      5.
      java -version:
      java version "1.2.1"
      Classic VM (build JDK-1.2.1-A, native threads)
      java -fullversion:
      java full version "JDK-1.2.1-A"

      6. N/A

      The code listed in section 2 runs without any problem on Solaris with

      java -version:
      java version "1.2.1"
      Solaris VM (build Solaris_JDK_1.2.1_02, native threads, sunwjit)
      java -fullversion:
      java full version "Solaris_JDK_1.2.1_02"
      running on SUNW,Ultra-Enterprise; sparc; sun4u with
      SunOS Release 5.7 Generic
      (Review ID: 93739)
      ======================================================================

      Name: krT82822 Date: 10/01/99


      To reproduce the problem you simply have to drag & drop with any simple program like Java Tutorial's examples for Drag & Drop.
      In the source code of the application you must include the following line:
      After "event.dropComplete(true);", to indicate the drop finish, you want to show a dialog with "JOptionPane.showMessageDialog(DropLabel.this,"OK!","OK!",JOptionPane.INFORMATION_MESSAGE);".
      The program hangs.

      It doesn't appear any message on screen, but the Task Administrator lets you see that the task is not responding.
      In Solaris 2.7 it works well but neither in Windows 98 nor Windows NT 4.0.

      The output of java -version:
      java version "1.2.2"
      Classic VM (build JDK-1.2.2-W, native threads, symcjit)

      The output of java -fullversion
      java full version "JDK-1.2.2-W"

      --------------

      10/1/99 eval1127 -- probably 4261459, 4156029 or 4207805
      (Review ID: 96019)
      ======================================================================

      The above program also fails on Win'98. This bug is causing several JCK's
      AWT interactive regression tests to fail; therefore, I'm upgrading its status
      to "Red". I also evaluated #4196035 and the JCK tests all have the same
      symptoms, the VM hang up right after accepting the drop.

      Roger Pham 10/12/99

        Attachments

          Activity

            People

            • Assignee:
              dmendenhsunw David Mendenhall (Inactive)
              Reporter:
              rlewis Roger Lewis (Inactive)
            • Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:
                Imported:
                Indexed: