IDEMPIERE-677 Deleting the last row in the swing clients grid view causes an indexoutofbounds exception / Thanks to Jan Thielemann

This commit is contained in:
Carlos Ruiz 2013-09-11 18:53:20 -05:00
parent 546c85b4d6
commit 731b4863dd
1 changed files with 11 additions and 1 deletions

View File

@ -49,7 +49,8 @@ public final class VTable extends CTable
/**
*
*/
private static final long serialVersionUID = -2655102084935019329L;
private static final long serialVersionUID = -3878986086328742243L;
private final static String PACK_ALL_COMMAND = CColumnControlButton.COLUMN_CONTROL_MARKER + "packAll";
/**
@ -197,4 +198,13 @@ public final class VTable extends CTable
.append(getModel()).append("]").toString();
} // toString
/**
* Sets the row selection interval. If the index is out of bounds we decrement it before setting the JTables row selection interval
*/
@Override
public void setRowSelectionInterval(int index0, int index1) {
super.setRowSelectionInterval( index0 == getRowCount() && index0 > 0 ? --index0 : index0,
index1 == getRowCount() && index1 > 0 ? --index1 : index1);
}
} // VTable