How to make a JButton add user input to an ArrayList and display it in a JList <p>I have an app that contains 3 classes - main gui (Book), add, contact.</p> <p>I have a JList in my phonebook class. I have a dialog window as my add class as it needs to add a contact, now I can add the data but storing it into an array and then placing that into a JList is proving tricky.</p> <p>Would anyone be able to help? I am new to java and I understand that I will need to use defaultListModel at some point but I don't quite understand where</p> <p>My button in the add class is called btnOK my arraylist is just ArrayListcontact my JList is just called list.</p> <p>Thanks to anyone who can help!</p>