Java Utililty Methods JTable Cell Editor

List of utility methods to do JTable Cell Editor

Description

The list of methods to do JTable Cell Editor are organized into topic(s).

Method

voidstopCellEditing(JTable table)
Workaround for a very annoying bug in jtable where an editing cell value does not get committed on focus lost.
int row = table.getEditingRow();
int col = table.getEditingColumn();
if (table.isEditing()) {
    if (row < table.getRowCount()) {
        table.getCellEditor(row, col).stopCellEditing();
voidstopEditing(JTable table)
stop Editing
if (table == null) {
    return;
if (table.isEditing()) {
    table.getCellEditor(table.getEditingRow(), table.getEditingColumn()).stopCellEditing();
voidstopEditing(JTable table)
Stops any editing for a given cell on a table.
if (table == null) {
    assert (false);
    return;
if (table.isEditing()) {
    int row = table.getEditingColumn();
    int col = table.getEditingRow();
    if (row >= 0 && col >= 0) {
...
voidstopEditing(JTable table)
stop Editing
if (table != null && table.getCellEditor() != null) {
    table.getCellEditor().stopCellEditing();
voidstopEditingOnLosingFocus(final JTable table)
stop Editing On Losing Focus
table.putClientProperty("terminateEditOnFocusLost", Boolean.TRUE);
voidstopTableEditing(JTable table)
Stop any editing that is currently being done on the table.
if (table.isEditing()) {
    TableCellEditor cellEditor = table.getCellEditor(table.getEditingRow(), table.getEditingColumn());
    cellEditor.stopCellEditing();