Hey guys,
I've been looking around the web but can't find a definite answer for this one.
I have a program I'm making and I want to cut down my lines by using an array and just have it create my lines for me.
I have this set up
String[] colors = new String {"red", "yellow", "green"};
for (int i = 0; i < colors.length; i++) {
textarea.setBackground(Color.colors[i]);
}
this is my logic, bit it doesn't work...
so in my array i thought of doing this
String[] colors = new String {".setBackground(Color.red)".. etc};
then have maybe a string or something to show
"textarea" + colors[i];
but i'm not sure how to get that to work, or pass the string into my code and not as output to the user.