You did not tell how to attach a String to match the correct array element so I do not know what is wrong.

Why not use a pair of arrays like this:



int colours[]={1,2,3,4,5,6,};
String...