Fix ArrayIndexOutOfBoundsException in ButtonColumn.actionPerformed

Don't call convertRowIndexToModel with a -1 row.
This commit is contained in:
draxdyn 2016-06-14 18:28:53 +02:00
parent a9744b2d04
commit d671a22398

View file

@ -111,7 +111,7 @@ public class ButtonColumn extends AbstractCellEditor implements TableCellRendere
@Override
public void actionPerformed(ActionEvent e) {
if (table.getRowCount() > 0 && table.getRowCount() >= table.getEditingRow()) {
if (table.getRowCount() > 0 && table.getRowCount() >= table.getEditingRow() && table.getEditingRow() >= 0) {
int row = table.convertRowIndexToModel(table.getEditingRow());
fireEditingStopped();
ActionEvent event = new ActionEvent(table, ActionEvent.ACTION_PERFORMED, "" + row);