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

JTable does not handle editable JComboBox as cell editor correctly

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: P3 P3
    • 1.4.0
    • 1.3.0
    • client-libs
    • beta2
    • x86, sparc
    • solaris_7, windows_98

      ing the default cell editor in a JTable, if I click to edit a cell,
      type in some characters, and then click in another cell, the newly
      entered text is made part of the field.

      If I use an editable JComboBox as a cell editor, click in the cell to
      edit it, type some characters into the text field in the JComboBox, and
      then click in another cell, the text entered into the JComboBox is not
      made part of the field. Instead, you have to hit Enter after entering
      the text, before clicking in another field. Of course, hitting Enter in
      a regular text field moves you to the next row.

      This inconsistency makes it difficult to use a JComboBox as a cell editor
      with a set of canned values that are easy to enter into a field.

      ================
      More description from a duplicate bug:

      A JComboBox using the DefaultCellEditor (in a JTable) shows the following
      problems:

      1. Pressing ESC while the drop down list is displayed removes the list
         but does not cancel the JTextField editor.

      2. If you modify the value in the text field, the only way to accept
         the change is to press return. If you click on another cell in the table
         the change is lost.

      Reproduced with Java 1.3.0-C on Solaris using TableExample4 in the Swing 1.1
      examples (change the combobox to be editable).

            mdavidsosunw Mark Davidson (Inactive)
            bshannon Bill Shannon (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Resolved:
              Imported:
              Indexed: