diff -r 6f08e6011e7e -r 3ba3d39b91c7 src/java.desktop/share/classes/javax/swing/plaf/basic/BasicTableUI.java --- a/src/java.desktop/share/classes/javax/swing/plaf/basic/BasicTableUI.java Tue Aug 14 12:11:28 2018 -0700 +++ b/src/java.desktop/share/classes/javax/swing/plaf/basic/BasicTableUI.java Thu Aug 16 11:15:22 2018 +0530 @@ -1872,7 +1872,12 @@ // 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; + } } }