title: Adding an ArrayList created in a method to JCombobox
body: <p>I've asked a similar question before, but realised the main issue at hand which I cannot solve:</p>
  
  <p>Currently have an ArrayList called <em>SundayList</em> which is loaded as soon as the frame <em>AddStudent</em> is loaded (bit of GUI)</p>
  
  <p>The <strong>Add Student</strong> class:
  <strong><em>Edited</em></strong></p>
  
  <pre><code>public class AddStudent extends javax.swing.JFrame {
  
      public AddStudent() {
      initComponents();
       }
  private void loadLists() throws IOException
      {
          //Creating the array of Activities to put into the ComboBoxes
          File f = new File("Activities.dat");
  
          sundayList = new ArrayList&lt;&gt;();
          mondayList= new ArrayList&lt;&gt;();
          tuesdayList= new ArrayList&lt;&gt;();
          wednesdayList= new ArrayList&lt;&gt;();
          thursdayList= new ArrayList&lt;&gt;();
  
  
  try{
      BufferedReader reader = new BufferedReader(new FileReader(f));
  
       while(reader.ready())
          {
              String CDay = reader.readLine();                               
              String CActivityName = reader.readLine();
              String CSupervisor = reader.readLine();
              String CLocation = reader.readLine();
              String CPaid = reader.readLine();
              String nothing = reader.readLine();
  
              if(CDay.equals("Sunday"))
              {
                  sundayList.add(CActivityName);
              }
              else if(CDay.equals("Monday"))
              {
                  mondayList.add(CActivityName);
              }
              else if(CDay.equals("Tuesday"))
              {
                  tuesdayList.add(CActivityName);
              }
              else if(CDay.equals("Wednesday"))
              {
                  wednesdayList.add(CActivityName);
              }
              else if(CDay.equals("Thursday"))
              {
                  thursdayList.add(CActivityName);
              }                
      }
      reader.close();
  }
  catch (IOException ex) 
  {
      Logger.getLogger(StartUpFrame.class.getName()).log(Level.SEVERE, null, ex);
  } 
  }
  ...
  comboboxSunday = new javax.swing.JComboBox();
  ...
  }
  
  
  
   public static void main(String args[]) {
  
          /* Create and display the form */
          java.awt.EventQueue.invokeLater(new Runnable() {
              public void run() {
                  new AddStudent().setVisible(true);
              }
          });
      }
  </code></pre>
  
  <p>For a start,I've tried to call the list <em>SundayList</em> into the combo box <em>comboboxSunday</em> to populate it, but only got the <em>cannot find symbol</em> error.</p>
  
  <p>What do I need to do to make this possible?</p>
  
  <p>Also, I plan on avoiding the mySQL involved method I've seen before, as I'm not familiar with it..</p>
  
  <p><strong>Current Coding for Combo box</strong></p>
  
  <p>The code automatically generated for the combo box by Netbeans is:</p>
  
  <pre><code>comboboxSunday = new javax.swing.JComboBox();
  
  comboboxSunday.setModel(new javax.swing.DefaultComboBoxModel&lt;&gt;(sundayList.toArray(new String[sundayList.size()])));
  </code></pre>