code: @Override
      public Component getTableCellEditorComponent(JTable table, Object value,
              boolean isSelected, int rowIndex, int vColIndex) {
          // 'value' is value contained in the cell located at (rowIndex, vColIndex)
          
          if (isSelected) {
              // cell (and perhaps other cells) are selected
          }
          
          // Configure the component with the specified value
          button.setText((String)value);
  
          row = rowIndex;
          
          // Return the configured component
          return button;
      }
docs: This method is called when a cell value is edited by the user.