JDK-4748359 : Click in JTableHeader cancels Cell Editor changes
  • Type: Bug
  • Component: client-libs
  • Sub-Component: javax.swing
  • Affected Version: 1.4.1
  • Priority: P4
  • Status: Closed
  • Resolution: Duplicate
  • OS: windows_2000
  • CPU: x86
  • Submitted: 2002-09-17
  • Updated: 2005-09-19
  • Resolved: 2005-09-19
Related Reports
Duplicate :  
Description
Name: jk109818			Date: 09/16/2002


FULL PRODUCT VERSION :
java version "1.4.0_01"
Java(TM) 2 Runtime Environment, Standard Edition (build 1.4.0_01-b03)
Java HotSpot(TM) Client VM (build 1.4.0_01-b03, mixed mode)

AND

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

FULL OPERATING SYSTEM VERSION :
Microsoft Windows 2000 [Version 5.00.2195]

A DESCRIPTION OF THE PROBLEM :
In the following sample, if you have started to edit a cell
in a JTable and then click somewhere in the JTableHeader,
the contents of the cell are lost as the cell editor is
cancelled.

STEPS TO FOLLOW TO REPRODUCE THE PROBLEM :
1. Start the sample program
2. double click in any cell
3. type some text
4. click anywhere in the table header.

EXPECTED VERSUS ACTUAL BEHAVIOR :
I would expect the cell editor to stop editing and the value
entered to remain in the cell.  Instead, the cell editor is
cancelled and any text entered is lost.

REPRODUCIBILITY :
This bug can be reproduced always.

---------- BEGIN SOURCE ----------
import javax.swing.*;
import javax.swing.table.*;
import java.awt.*;
import java.awt.event.*;

public class TableTest
{
    public static void main( String[] args )
    {
        try
        {
            final JTable table = new JTable( 20, 20 );

            JFrame frame = new JFrame();
            JScrollPane scroll = new JScrollPane();
            scroll.setViewportView( table );
            frame.getContentPane().add( scroll, BorderLayout.CENTER );
            frame.pack();
            frame.addWindowListener(new WindowAdapter() {
                public void windowClosing(WindowEvent e) {
                    System.exit(0);
                }
            });
            

            frame.show();
        }
        catch ( Exception e )
        {
            e.printStackTrace();
        }
    }
}

---------- END SOURCE ----------
(Review ID: 164568) 
======================================================================

Comments
EVALUATION Yes, there have been multiple bugs filed surrounding this issue. I will keep this one open until I find an appropriate duplicate or fix it. ###@###.### 2002-10-18
18-10-2002