Create shapes and put it inside the array list. (Java)
<p>So I need to create about 10 shapes and put it in the array list shapes and then passes the list to the component.</p>

<p>I need a little bit of help and want to know if I'm on the right track.</p>

<p>So here's the code:</p>

<pre><code>public class ShapeDemo
{
    public static final int WIDTH = 300 ;
    public static final int HEIGHT = 400 ;

    public static void main(String[] args)
    {
     ArrayList&lt;Shape&gt; shapes = new ArrayList&lt;Shape&gt;() ;
     Random random = new Random() ;
     int x, y ;
     // create the ten shapes and put them in shapes array list below.
     /*
        put code here

     */

     JComponent component = new ShapeComponent2(shapes) ;
     JFrame frame = new JFrame("") ;
     frame.add(component) ;
     frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE) ;
     frame.setSize(WIDTH, HEIGHT) ;
     frame.setVisible(true) ;
    }
}
</code></pre>

<p>What I was thinking of doing was for creating the shapes is:</p>

<pre><code>shapes.add( new Ellipse.Double(x,y,WIDTH,HEIGHT));
</code></pre>

<p>Doing that with 10 times. But that doesn't work.</p>

<p>Any help will be appreciated. </p>

<p>Edit:
These are my imports:</p>

<pre><code>import javax.swing.JFrame ;
import javax.swing.JComponent ;
import java.awt.Rectangle ;
import java.awt.geom.Line2D ; 
import java.awt.geom.Ellipse2D ;
import java.awt.geom.Arc2D ;
import java.awt.Shape ;
import java.util.ArrayList ;
import java.util.Random ;
</code></pre>