提交 8c9b0f7f 编写于 作者: A alexp

4330950: Lost newly entered data in the cell when resizing column width

Reviewed-by: peterz
上级 022ab593
...@@ -4574,9 +4574,8 @@ public class JTable extends JComponent implements TableModelListener, Scrollable ...@@ -4574,9 +4574,8 @@ public class JTable extends JComponent implements TableModelListener, Scrollable
* @see TableColumnModelListener * @see TableColumnModelListener
*/ */
public void columnMoved(TableColumnModelEvent e) { public void columnMoved(TableColumnModelEvent e) {
// If I'm currently editing, then I should stop editing if (isEditing() && !getCellEditor().stopCellEditing()) {
if (isEditing()) { getCellEditor().cancelCellEditing();
removeEditor();
} }
repaint(); repaint();
} }
...@@ -4593,8 +4592,8 @@ public class JTable extends JComponent implements TableModelListener, Scrollable ...@@ -4593,8 +4592,8 @@ public class JTable extends JComponent implements TableModelListener, Scrollable
* @see TableColumnModelListener * @see TableColumnModelListener
*/ */
public void columnMarginChanged(ChangeEvent e) { public void columnMarginChanged(ChangeEvent e) {
if (isEditing()) { if (isEditing() && !getCellEditor().stopCellEditing()) {
removeEditor(); getCellEditor().cancelCellEditing();
} }
TableColumn resizingColumn = getResizingColumn(); TableColumn resizingColumn = getResizingColumn();
// Need to do this here, before the parent's // Need to do this here, before the parent's
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册