4330950: Lost newly entered data in the cell when resizing column width
Reviewed-by: peterz
This commit is contained in:
parent
76501ba258
commit
1c45f6db9e
@ -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
|
|||||||
* @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
|
||||||
|
Loading…
Reference in New Issue
Block a user