-
Bug
-
Resolution: Incomplete
-
P4
-
None
-
1.4.0, 6
-
x86
-
windows_98, windows_nt, windows_xp
1) TestSpinnerEditorProblem.java (attached):
Compile and run the program.
Click in the top left cell and a spinner appears.
Click in the bottom left cell - the spinner appears quickly and then dissapears.
When the property "terminateEditOnFocusLost" is turned on, we have a listener that removes the editor when focus is moved somewhere outside the table. Here's what's happening:
Spinner is removed from table.
AWT does an auto transfer of focus due to the remove.
Spinner is added again to table in the new place.
Due to the asynchronous nature of focus notifications, we are notified after the spinner is added again about this focus change. As a result, the editor is removed.
2) Launch SwingSet2 and switch to the table demo.
Click on one of the combo box cells and the combo pops up.
Click on another of the cells - the combo pops up and then hides.
Again, this occurs again because AWT transfers focus somewhere else automatically in between and when we're notified later, the popup is cancelled.
I suspect there are work-arounds to all of this. For example, to fix #1 we could create a traversal policy such that the autotransfer goes to the table. However, all of these could be fixed with API that tells AWT not to auto transfer focus. (Additionally, we'd have to revert the change to 4887999 to fix the combo box problem demonstrated with SwingSet2 - we'd then need to seek a new fix for that bug).
###@###.### 2004-12-20 19:49:58 GMT
- duplicates
-
JDK-4760073 Table combox cell does not handle mouse click consistently.
- Closed
-
JDK-6513874 JComboBox in DefaultCellEditor does not always show popup when beginning edit
- Closed
- relates to
-
JDK-6505027 terminateEditOnFocusLost making problems for table in JDesktopPane
- Resolved
-
JDK-6180261 Focus error when disabling in focus JTextField from TreeSelectionListener
- Closed
-
JDK-4778542 property "terminateEditOnFocusLost" results in distorted cell when editing table
- Resolved
-
JDK-4887999 JComboBox CellEditor causes JTable to lose focus after editing
- Resolved