This patch fixes the ArrayIndexOutOfBounds exception problem when repainting the table. The row count, returned by getRowCount(), must be "end exclusive".

2006-02-14  Audrius Meskauskas  <[EMAIL PROTECTED]>

* javax/swing/JTable.java (rowAtPoint): Return -1 if the computed row = getRowCount().
Index: javax/swing/JTable.java
===================================================================
RCS file: /sources/classpath/classpath/javax/swing/JTable.java,v
retrieving revision 1.70
diff -u -r1.70 JTable.java
--- javax/swing/JTable.java	14 Feb 2006 15:17:59 -0000	1.70
+++ javax/swing/JTable.java	14 Feb 2006 19:49:01 -0000
@@ -1959,7 +1959,7 @@
         int y = point.y;
 
         int r = y / height;
-        if (r < 0 || r > nrows)
+        if (r < 0 || r >= nrows)
           return -1;
         else
           return r;

Reply via email to