title: How to declare and add to a global array list?
body: <p>I have a project on entering an integer value into a global array. I'm using ArrayList and can't seem to figure out how to add values into the array I'm not quite sure how to add the integer to the array, as it is global and the actionPerformed function is local. Also, is where the array was declared considered correct?</p>
  
  <pre><code>private void btnAddActionPerformed(java.awt.event.ActionEvent evt) {                                       
      int intEnter = Integer.parseInt(this.txtEnter.getText());
  }                                      
  
  
  public static void main(String args[]) {
      ArrayList &lt;Integer&gt; intMarks = new ArrayList();
      java.awt.EventQueue.invokeLater(new Runnable() {
          public void run() {
              new MarksCalculator().setVisible(true);
          }
      });
  }
  </code></pre>