// Add the value when the button is clicked // calls the storeMemo() function in the memopad class and passes the text from the text field into the storememo function private void addButtonActionPerformed(java.awt.event.ActionEvent evt) { memopad.storeMemo(memoTF.getText()); memoTF.setText(" "); jTextArea1.setEditable(false); } // do a loop // the error you're getting is due to only 1 entry being in the arraylist, whereas we are looping 20 times, ignore it // set jTextArea1 to show the result returned from showMemos private void updateButtonActionPerformed(java.awt.event.ActionEvent evt) { int i; for(i=0; i<20; i++){ if(i<1){ jTextArea1.setText(memopad.showMemos(i) + newline); }else{ jTextArea1.append(memopad.showMemos(i) + newline); } } } public String showMemos(int i) { return memos.get(i); }