문제

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};
도움이 되었습니까?

해결책

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.

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top