More Three By Three Images

Three By Three Images Applet: You will recreate this applet. This applet is very similar to the previous applet, but a different technique is used to create it. It is very difficult to see the individual pixels in this applet, but here are the color arrangements. There are only three colors used yellow (y), cyan (c), and magenta (m). Here are the layouts used in each 3x3 image:
  cyc      mcm     ycm
  yyy      cmc     ycm
  cyc      mcm     ycm

This is the third technique you've seen for populating an image. In the first lesson you saw how a for loop can be used to populate the array which is used to define an image. In the second lesson you saw how each element in an array can be individually given a value. This lesson uses a slightly different technique.

New Step: Declare and populate the array in one step.

  int p1[] = { red, red, red,
               yellow, yellow, yellow,
               red, red, red };
Here red and yellow contain integer values for the color they are named after.

Other than this you just declare an instance of the Image class before your init class and create the image in your init class just like you've done before.