Code example for SimpleDateFormat

Methods: setLenient, setTimeZone, toLocalizedPattern

0
        column.setHeaderValue(columnName);
        column.setPreferredWidth(30);
        column.setMaxWidth(30);
        column.setMinWidth(30);
      } 
      else 
      { 
        final Class columnType = getModel().getColumnClass(modelColumn);
        column.setHeaderValue(new TypedHeaderInformation(columnType, columnName));
      } 
    } 
    getColumnModel().addColumn(column);
 
  } 
 
 
  public void addColumn(final String aHeaderName)
  { 
    stopEditing(); 
    tableHeader.removeEditor();
    tableModel.addColumn(aHeaderName, String.class);
 
  } 
 
  public void addRow() 
  { 
    stopEditing(); 
    final int row = getSelectedRow();
    if (row == -1)
    { 
      tableModel.addRow();
      setRowSelectionInterval(getRowCount() - 1, getRowCount() - 1); 
    } 
    else 
    { 
      tableModel.addRow(row + 1);
      setRowSelectionInterval(row + 1, row + 1);
    } 
  } 
 
  public void removeRow() 
  { 
    stopEditing(); 
    final int[] rows = getSelectedRows();
    for (int i = rows.length - 1; i >= 0; i -= 1)
    { 
      final int row = rows[i];
      tableModel.removeRow(row);
    } 
    tableModel.fireTableDataChanged();
  } 
 
  public void removeColumn() 
  { 
    stopEditing(); 
    tableHeader.removeEditor();
    final int modelIndex = selectedColumn.getModelIndex();
    if (modelIndex == 0)
    { 
      return; 
    } 
    tableModel.removeColumn(modelIndex - 1);
  } 
 
  public void setSelectedColumn(final TableColumn aSelectedColumn)
  { 
    selectedColumn = aSelectedColumn;
  } 
 
  public void setTableEditorModel(final TableModel model)
  { 
    tableModel.copyInto(model);
  } 
 
  public TableModel getTableEditorModel() 
  { 
    return tableModel.createModel();
  } 
 
  public void stopEditing() 
  { 
    final TableCellEditor cellEditor = getCellEditor();
    if (cellEditor != null)
    { 
      cellEditor.stopCellEditing();
    } 
  } 
}