JDK-4480264 : JTable cell editor lost focus bug in SwingSet2 demo
  • Type: Bug
  • Component: client-libs
  • Sub-Component: javax.swing
  • Affected Version: 1.4.0
  • Priority: P5
  • Status: Closed
  • Resolution: Duplicate
  • OS: windows_nt
  • CPU: x86
  • Submitted: 2001-07-16
  • Updated: 2002-05-25
  • Resolved: 2002-05-25
Related Reports
Duplicate :  
Description

Name: yyT116575			Date: 07/16/2001


java version "1.4.0-beta"
Java(TM) 2 Runtime Environment, Standard Edition (build 1.4.0-beta-b65)
Java HotSpot(TM) Client VM (build 1.4.0-beta-b65, mixed mode)

This bug is easily demonstrated in the example that comes with jdk1.4 and
jdk1.3. The example can be found in jdk1.4\demo\jfc\SwingSet2
\SwingSet2Plugin.html. After loading choose the JTable Demo.

Example one:
1. Dbl-Click on a cell in the Favorite Number column.
2. A text box appears and the number is displayed with decimals.
3. Edit the value and click on another control outside the table e.g. the
Selection Mode combo box.

Expected Result:
  The text box despairs and the number is formatted (the decimal point
despairs) - just as if you had clicked another cell/row.
Actual Result:
  The text box is still there (it's still got the black border) and had you
clicked a Save button the last edit would have been lost!!!


Example two:
1. Click on a cell in the Favorite Color column.
2. A combo box appears with a list of colors.
3. Now click on another control outside the table e.g. the Selection Mode combo
box.

Expected Result:
  The combo box despairs and turns into a color.
Actual Result:
  The combo box is still there!!
(Review ID: 128179) 
======================================================================

Comments
EVALUATION The persistent table cell editor problem seems to have been fixed in 1.4.beta2 and beyond. Sometimes I can get the first problem to appear in 1.4 FCS. The second problem only seems to go away in the 1.4.1. In fact, both problems are resolved in 1.4.1. The only unresolved issue is that the edited value in both cases is lost when the focus is transferred out of the table. That's OK since the gesture to commit the value in the cell was never called. To work around that, you would probably have to add a focus listener to the table and commit the edited value in focus lost. This appears to be a duplicate of 4503845. ###@###.### 2002-05-24
24-05-2002