Initializing an array before running a thread

I am making an array of 1s/0s then starting a thread to paint them as red. Because the array was before the thread the pixels should remain static as red 1s/0s. another part of paint should draw random colors continually as the red remains static.

Re: Initializing an array before running a thread

Do you have a question or a problem? If so, please ask it.

A comment on your code:
The list of if statements at the end of the paint method are mutually exclusive. If one is true none of the others can be true.
They should be coded as if/else if to show that. Why test for r == 2 if you've already found that r is 1?