The condition on your for
loop is wrong. The for
loop will only execute while the condition is true
. Try less than:
for(int xn=0;xn < jTable1.getRowCount();xn++){
This way, the loop will keep executing if xn
is less than the row count, and it will stop then xn
reaches the row count.