title: how to use ArrayList in Processing?
body: <p>The official explanation is here: <a href="http://processing.org/reference/ArrayList.html" rel="nofollow">ArrayList</a></p>
  
  <p>However, it uses iteration and confuses me.</p>
  
  <p>I am trying to make a drawing pen but something is wrong here: </p>
  
  <pre><code>drawings.get(i) = drawing.get(i-1);
  </code></pre>
  
  <hr>
  
  <pre><code>   ArrayList &lt;Drawing&gt; drawings = new ArrayList &lt;Drawing&gt;();
  
     void setup(){
      size(400,400);
      background(255);
      colorMode(HSB);
     }
  
     void draw(){}
  
     void mouseDragged(){
  
       drawings.add(new Drawing(mouseX,mouseY));
  
       for(int i = drawings.size()-1;i&gt;0;i--){
         drawings.get(i) = drawing.get(i-1);
        }
  
       for(int i=0;i&lt;drawings.size;i++){
         fill(c,100);
         drawings.get(i).display();}
    }
  
  
    class Drawing{
       float x,y,r;
       color c;
  
     Drawing(float ax,float ay){
       x=as;
       y=ay;
       r=random(2,20);
       c=color(random(100,200),255,255);
      }  
  
     void display(){
       fill(c,100);
       ellipse(drawing[i],r,r);}
  
    }
  </code></pre>
  
  <p>I still don't know how to use ArrayList.
  Does anyone know?</p>
  
  <p>Thank you.</p>