Building a 2d array to draw different color circles
<p>The code below will produce randomly generated circles of different colors. I need to be able to specify the color of the circle by it's size so that the loop will produce the same pattern of circles in different locations. This needs to be done with a 2d array. I know this is probably not that difficult, but I can't seem to grasp the concept.
Here are the directions and my code.</p>

<p>Thanks!</p>

<p>Set up a 2-D, int colors[][], array with 6 rows, one for each circle, and 3 columns, one for each element (Red, Green, Blue) of the colors to be used.  In the above display the color values were randomly generated in the range 0 to 255 at the beginning of the program.  Then for each diameter[i], color[i][0], color[i][1] and color[i][2] were used for the RGB levels. </p>

<pre><code>import java.io.*;
import java.util.*;
import java.awt.*;

public class Lab10 {

    /**
     * @param args
     */
    public static void main(String[] args) {


        Scanner console=new Scanner (System.in);


        Random r = new Random();

        int [] color= new int [3];
        color[0]=r.nextInt(256);
        color[1]=r.nextInt(256);
        color[2]=r.nextInt(256);

        System.out.println("Please enter 6 interger values. The values should be in descending order and in the range 100 to 1.");
        int[] diameters=new int[6];
        int colors[][] = new int [6][3];
        for(int i=0; i&lt;6; i++){
            diameters[i]=console.nextInt();//values entered
        }


        for (int i=0; i&lt;diameters.length;  i++) {
            for (int j = 0;  j &lt; color.length;  j++) {
              colors[i][j]=colors[i][j];
            }




        }



        int panelX = 400, panelY = 400;
        DrawingPanel panel = new DrawingPanel(panelX, panelY);
        panel.setBackground(Color.WHITE);

        Graphics g = panel.getGraphics();

        for (int i=0; i&lt;10; i++){
            int centerX=r.nextInt(350);
            int centerY=r.nextInt(350);
            for(int value:diameters){
                g.setColor(new Color(r.nextInt(256),r.nextInt(256), r.nextInt(256)));
                g.fillOval(centerX - value , centerY - value, 2 * value, 2 * value);
            }
        }
    }

    }
</code></pre>
