I'm a novice when it comes to Java, and because of that this is my first real application of java that might serve some purpose. I'm trying to recreate the popular handheld game "Simon" within an applet. There is to be four colors that brighten in sequence of what the arraylist "thearray" tells them. The code is rough at this point because I've been trying to create a delay after where the first color is brightened before it returns to its original color, so the user stands a fair chance of inputting the code back in. I was trying to do this originally for the user input, but I worked around that using mousepressed and released instead of clicked. I might be using threads incorrectly, but any study I put into timers simply confused me. Here's my code for the applet and the class that creates the boxes themselves.
and the box class
I apologize for any number of java laws I just broke.
There are no new questions, but there may be new answers.
Joined: May 28, 2012
Okay, so I'm working with javax.swing.Timer, and I think I understand what it's supposed to do, but I don't know how to make it happen. I have a timer created, repeats set to false, and started, but I need the actionlistener to do something, and I don't know how to continue. I need the
in side of the action listener, right? here's what I'm currently working with:
and the method of the action listener
the purpose if for the color to turn brighter, then after a delay return to its original color, and then the next color would do the same.