8202702: Clearing selection on JTable causes disappearance of a row

Reviewed-by: serb
This commit is contained in:
Prasanta Sadhukhan 2018-08-16 11:15:22 +05:30
parent 7000581e0b
commit bb9fed1008
2 changed files with 200 additions and 1 deletions

View file

@ -1872,7 +1872,12 @@ public class BasicTableUI extends TableUI
// and if there is any selected rows
if (rMax != (table.getRowCount() - 1) &&
(table.getSelectedRow() == -1)) {
rMax = rMax - 1;
// Do not decrement rMax if rMax becomes
// less than or equal to rMin
// else cells will not be painted
if (rMax - rMin > 1) {
rMax = rMax - 1;
}
}
}