Hi guys,
I am new to this forum and this is my very first post, i hope someone will be able to help me.
Please note i am a begninner so dont be too harsh on me.
Welcome to the Java Programming Forums
The professional, friendly Java community. 21,500 members and growing!
The Java Programming Forums are a community of Java programmers from all around the World. Our members have a wide range of skills and they all have one thing in common: A passion to learn and code Java. We invite beginner Java programmers right through to Java professionals to post here and share your knowledge. Become a part of the community, help others, expand your knowledge of Java and enjoy talking with like minded people. Registration is quick and best of all free. We look forward to meeting you.
>> REGISTER NOW TO START POSTING
Members have full access to the forums. Advertisements are removed for registered users.
Hi guys,
I am new to this forum and this is my very first post, i hope someone will be able to help me.
Please note i am a begninner so dont be too harsh on me.
Last edited by newtolearningjava; April 26th, 2014 at 06:12 PM.
Use an array of Colors: Color[] theColorArray = {Color.red, Color.blue};how i can set all the buttons different colours.
Access each element in turn inside of the setBackground(theColorArray[theIdx]) method.
Make sure the array has enough colors in it or make sure the index to the array: theIdx is reset to 0 when it gets to the end of the array.
If you don't understand my answer, don't ignore it, ask a question.
hi norm,
i do not understand this
Access each element in turn inside of the setBackground(theColorArray[theIdx]) method.
Make sure the array has enough colors in it or make sure the index to the array: theIdx is reset to 0 when it gets to the end of the array.
Do you understand arrays and how to use an index with them?
By changing the value of the index from 0 to the length of the array-1 the code can access each element in the array in turn. (in turn means: the first one, then the second one, then the third one, etc)
If you don't understand my answer, don't ignore it, ask a question.
If your new question builds on this program and still seems relevant to the thread title, sure, ask in this thread.
Nah. I think you made the right decision.