code: @Override
      public void setModel(TableModel newModel) {
          if (!(newModel instanceof PropertySheetTableModel)) {
              throw new IllegalArgumentException("dataModel must be of type "
                      + PropertySheetTableModel.class.getName());
          }
  
          if (cancelEditing == null) {
              cancelEditing = new CancelEditing();
          }
  
          TableModel oldModel = getModel();
          if (oldModel != null) {
              oldModel.removeTableModelListener(cancelEditing);
          }
          super.setModel(newModel);
          newModel.addTableModelListener(cancelEditing);
  
          // ensure the "value" column can not be resized
          getColumnModel().getColumn(1).setResizable(false);
      }
docs: Overriden to register a listener on the model. This listener ensures
  editing is canceled when editing row is being changed.
  
  @param newModel
  @see javax.swing.JTable#setModel(javax.swing.table.TableModel)
  @throws IllegalArgumentException if dataModel is not a
  {@link PropertySheetTableModel}