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

JTable does not handle editable JComboBox as cell editor correctly

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: P3
    • Resolution: Fixed
    • Affects Version/s: 1.3.0
    • Fix Version/s: 1.4.0
    • Component/s: client-libs
    • Labels:
    • Subcomponent:
    • Resolved In Build:
      beta2
    • CPU:
      x86, sparc
    • OS:
      solaris_7, windows_98

      Description

      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).

        Attachments

          Issue Links

            Activity

              People

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

                Dates

                Created:
                Updated:
                Resolved:
                Imported:
                Indexed: