-
Bug
-
Resolution: Duplicate
-
P4
-
None
-
1.4.0
-
x86
-
windows_95
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)
======================================================================
- duplicates
-
JDK-4503845 Cell editing does not complete when JTable loses focus
-
- Closed
-