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

CellEditorRemover active only after first edit

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Duplicate
    • Icon: P4 P4
    • None
    • 1.4.0
    • client-libs



      Name: gm110360 Date: 10/24/2001


      E:\jdk1.4\bin>java -version
      java version "1.4.0-beta2"
      Java(TM) 2 Runtime Environment, Standard Edition (build 1.4.0-beta2-b77)
      Java HotSpot(TM) Client VM (build 1.4.0-beta2-b77, mixed mode)



        To reproduce:
      1.Take a table of your choice. Make sure at least one cell is
      editable and there is at least one other component in the
      table's root window. (That's the szenario where cellEditorRemover
      should cancel an edit when the focus is transfered to some
      component that's not a child of the table).

      2. Edit a cell, click on that other component. The editing is cancelled.

      3. Again edit a cell, click on the other component. The editing is _not_
      cancelled.

      Analysis:

      JTable's editorRemover is added as a listener to the
      KeyboardFocusMangager in editCellAt(..) only when it is null (then
      the remover is created and added). It is removed as listener in
      removeEditor, but it is not nulled in that method. Consequently it
      is listening to focusManager propertyChanges only on the very first
      edit after creation.

        Fix:
      A. Either null the editorRemover in removeEditor after removing it as
      listener from focusManager
      B. or decouple the logic of creation of editorRemover from adding it as
      listener.

      I suspect you have to do A as focusManagers might change between calls
      to editCellAt.

      Response from bug submitter: -

      take the SwingSet2 as test case.
      (Review ID: 134285)
      ======================================================================

            dmcduffisunw Dale Mcduffie (Inactive)
            gmanwanisunw Girish Manwani (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Resolved:
              Imported:
              Indexed: