Name: gm110360 Date: 10/24/2001
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)
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_
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.
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
I suspect you have to do A as focusManagers might change between calls
Response from bug submitter: -
take the SwingSet2 as test case.
(Review ID: 134285)