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

Calling removeEditor on JTable incorrectly forces focus.

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: P4 P4
    • 1.4.0
    • 1.1.8
    • client-libs
    • beta
    • x86
    • windows_nt



      Name: clC74495 Date: 11/02/99


      I'm using Swing 1.1.1

      If you call removeEditor() on JTable it stops editing as one
      would expect. However this method also requests focus for the table
      regardless of whether the editor component actually had focus.

      Relevant bit of code is (JTable 1.120):

          public void removeEditor() {
              TableCellEditor editor = getCellEditor();
              if(editor != null) {
                  editor.removeCellEditorListener(this);

      ****
                  requestFocus(); <---- Don't think this is right
      ****
                  remove(editorComp);

                  Rectangle cellRect = getCellRect(editingRow, editingColumn, false);

                  setCellEditor(null);
                  setEditingColumn(-1);
                  setEditingRow(-1);
                  editorComp = null;

                  repaint(cellRect);
              }
      (Review ID: 97284)
      ======================================================================

            pmilnesunw Philip Milne (Inactive)
            clucasius Carlos Lucasius (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Resolved:
              Imported:
              Indexed: