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

Cursor does not appear in JTable cell editor component when setDragEnabled(true)

XMLWordPrintable

    • x86
    • windows_nt, windows_2000



      Name: jk109818 Date: 03/14/2003


      FULL PRODUCT VERSION :
      java version "1.4.1_01"
      Java(TM) 2 Runtime Environment, Standard Edition (build 1.4.1_01-b01)
      Java HotSpot(TM) Client VM (build 1.4.1_01-b01, mixed mode)

      A DESCRIPTION OF THE PROBLEM :
      In JTable, cursor does not appear in cell editor component when drag enabled with any custom or default TransferHandler.

      STEPS TO FOLLOW TO REPRODUCE THE PROBLEM :
      1. Start the example
      2. Try to start editing by double click on cell


      EXPECTED VERSUS ACTUAL BEHAVIOR :
      Editing started, JTextField gained keyboard focus

      Editing started but keyboard focus isn't transfered to JTextField


      REPRODUCIBILITY :
      This bug can be reproduced always.

      ---------- BEGIN SOURCE ----------
      import javax.swing.*;
      import java.awt.*;

      public class TestStartup extends JFrame {

      protected JPanel cp;

      public TestStartup() {
      super();
      setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);

      String[][] rowData = new String[][]
      {
      {"first", "second"},
      {"third", "forth"}
      };

      String[] columnNames = new String[]{"first", "second"};

      JTable table = new JTable(rowData, columnNames);
      table.setSurrendersFocusOnKeystroke(true);
      table.setTransferHandler(new TransferHandler("selectionBackground"));
      table.setDragEnabled(true);

                      cp = new JPanel(new BorderLayout());
      cp.add(new JScrollPane(table), BorderLayout.NORTH);
      setContentPane(cp);
      }

      public static void main(String[] args) {
      TestStartup test = new TestStartup();
      test.pack();
      test.setVisible(true);
      }
      }

      ---------- END SOURCE ----------
      (Review ID: 182653)
      ======================================================================

            shickeysunw Shannon Hickey (Inactive)
            jkimsunw Jeffrey Kim (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Resolved:
              Imported:
              Indexed: