changeset 2925:e753db9c4416

4330950: Lost newly entered data in the cell when resizing column width Reviewed-by: peterz
author alexp
date Fri, 17 Sep 2010 23:21:51 +0400
parents a8ec7a461254
children 76b39a4964fa
files src/share/classes/javax/swing/JTable.java
diffstat 1 files changed, 4 insertions(+), 5 deletions(-) [+]
line wrap: on
line diff
--- a/src/share/classes/javax/swing/JTable.java	Fri Sep 17 23:16:19 2010 +0400
+++ b/src/share/classes/javax/swing/JTable.java	Fri Sep 17 23:21:51 2010 +0400
@@ -4574,9 +4574,8 @@
      * @see TableColumnModelListener
      */
     public void columnMoved(TableColumnModelEvent e) {
-        // If I'm currently editing, then I should stop editing
-        if (isEditing()) {
-            removeEditor();
+        if (isEditing() && !getCellEditor().stopCellEditing()) {
+            getCellEditor().cancelCellEditing();
         }
         repaint();
     }
@@ -4593,8 +4592,8 @@
      * @see TableColumnModelListener
      */
     public void columnMarginChanged(ChangeEvent e) {
-        if (isEditing()) {
-            removeEditor();
+        if (isEditing() && !getCellEditor().stopCellEditing()) {
+            getCellEditor().cancelCellEditing();
         }
         TableColumn resizingColumn = getResizingColumn();
         // Need to do this here, before the parent's