Question

How can I create a table of Color elements like below ?

private Color[] = {Color.black, Color.darkGray, Color.gray, Color.lightGray, Color.pink, Color.orange, Color.cyan, Color.yellow, Color.magenta};
Was it helpful?

Solution

In respect to your comment, your problem is that you have not correctly initialized your variable, in fact you forgot to name it.

Use

private Color[] colors = {Color.black, Color.darkGray, Color.gray, Color.lightGray, Color.pink, Color.orange, Color.cyan, Color.yellow, Color.magenta};

instead of your's and you can use your array.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top