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

JTextField shows a cursor after drop operation closes

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: P4 P4
    • 1.4.0
    • 1.4.0
    • client-libs
    • beta2
    • x86
    • windows_2000



      Name: bsC130419 Date: 05/29/2001


      java version "1.4.0-beta"
      Java(TM) 2 Runtime Environment, Standard Edition (build 1.4.0-beta-b65)
      Java HotSpot(TM) Client VM (build 1.4.0-beta-b65, mixed mode)


      Create a JTree and JTextField. make setDragEnabled(true) on both. Drop some
      item from JTree to JTextField. After that, the focus is in the JTree, but
      JTextField blinks with the cursor.


      import javax.swing.*;
      import java.awt.*;

      public class TestDnD
      {
          public static void main(String args[])
          {
              try
              {
                  UIManager.setLookAndFeel
      (UIManager.getCrossPlatformLookAndFeelClassName());

                  JFrame frame = new JFrame();

                  JPanel panel = new JPanel();

                  FlowLayout layout = new FlowLayout(FlowLayout.CENTER, 20, 20);
                  panel.setLayout(layout);

                  JTextField textField = new JTextField();
                  textField.setPreferredSize(new Dimension(100, 20));
                  textField.setDragEnabled(true);
                  panel.add(textField);

                  JTree tree = new JTree();
                  tree.setDragEnabled(true);
                  panel.add(tree);

                  frame.getContentPane().add(panel);

                  frame.setSize(640, 480);
                  frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);

                  frame.setVisible(true);
              }
              catch (Exception e)
              {
                  e.printStackTrace();
              }
          }
      }
      (Review ID: 125109)
      ======================================================================

            shickeysunw Shannon Hickey (Inactive)
            bstrathesunw Bill Strathearn (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Resolved:
              Imported:
              Indexed: