Here you can find the source of cancelTableEditing(final JTable table)
public static void cancelTableEditing(final JTable table)
//package com.java2s; import javax.swing.JTable; public class Main { public static void cancelTableEditing(final JTable table) { if (table.isEditing()) { int row = table.getEditingRow(); int col = table.getEditingColumn(); table.getCellEditor(row, col).cancelCellEditing(); }/*from w w w . j a va 2 s . com*/ } }