title: How to load a serialized file back to an arrayList
body: <p>ive looked at a few problems on this matter already but couldnt resolve my issue.</p>
  
  <p>As you can see below, i save all the objects in my <code>Patient ArrayList</code>(<code>pList</code> - which is private at the top of the class) into the "Patient.ser" file through serialization. As far as i can tell this is working with no problems. "<code>patSizeAtSave</code>" is a private variable which i am using to mark as a bound to work with when loading the file(see below)</p>
  
  <p>the "<code>patModel</code>" is the <code>DefaultListModel</code> i use for the <code>JLists</code> in my <code>GUI</code> so i try to populate those lists with what has been added back to the <code>Patient ArrayList(pList)</code></p>
  
  <p><strong>MY PROBLEM</strong>: When i hit the load button on the <code>GUI</code> it calls the <code>loadPatientList()</code> method below, but nothing is being put into my JLists so i can't tell if it works at all. </p>
  
  <p>Any idea's on how to fix this?</p>
  
  <pre><code>private void savePatientList() throws FileNotFoundException {
      try
      {
      FileOutputStream fs = new FileOutputStream("Patient.ser");
      ObjectOutputStream os = new ObjectOutputStream(fs);
      for(Patient p: pList)
      {
          os.writeObject(p);
      }
      fs.close();
      os.close();
      patSizeAtSave = pList.size();
      JOptionPane.showMessageDialog(jTabPane, "Save Complete!", "Notification", JOptionPane.INFORMATION_MESSAGE);
      } 
      catch (IOException ex) {
          Logger.getLogger(MainFrame.class.getName()).log(Level.SEVERE, null, ex);
      } 
  
  }
  private void loadPatientList()
  {
      FileInputStream fs;
      ObjectInputStream is;
      try
      {
      fs = new FileInputStream("Patient.ser");
      is = new ObjectInputStream(fs);
  
      for(int i = 0; i &lt; patSizeAtSave; i++)
      {
          Patient p = (Patient) is.readObject();
          pList.add(p);
          patModel.addElement(p.getPNo() + ": " + p.getPName());
      }
      jListPatient.setModel(patModel);
      jListPatient2.setModel(patModel);
      fs.close();
      is.close();
      } 
      catch (FileNotFoundException ex) {
          Logger.getLogger(MainFrame.class.getName()).log(Level.SEVERE, null, ex);
      } catch (IOException | ClassNotFoundException ex) {
          Logger.getLogger(MainFrame.class.getName()).log(Level.SEVERE, null, ex);
      }
  }
  </code></pre>