 <p>First of all, you want</p> <pre><code>for (int x=0; x&lt;= numOfStudents; x++) </code></pre> <p>or when numOfStudents = 0 you'll never go into the loop.</p> <p>Also, does addButtonActionPerformed have a for loop that contains the code you've given us? Otherwise, it seems like every time you go into that method numOfStudents will be 0 and when you exit it'll be 1, but the code is only executed for numOfStudents = 0. Am I missing something?</p>