I have a simple memory game that I've been trying to debug. It allows the user to flip two cards, compares them, if they are a match they stay up, otherwise get flipped back over. Problem is, for the second card flipped, it next does the comparison so quickly, it doesn't seem that the second card was ever displayed.
Any ideas on how to fix this, or is there something I'm missing? I spent most of the day on sun's website trying to figure out threads and sleep vs wait... you can tell I'm not an expert. TIA!
Remove all other thread code, start a new thread inside the 'checkForMatch' method, begin the run method with the desired delay, proceed with checking...
[ May 18, 2005: Message edited by: Craig Wood ]
Joined: May 18, 2005
thank you! Can't tell you how long I looked at thread samples but wasn't sure how to integrate them into my own code. I also found the Timer method, which worked too.
Now it's not working as I try to convert to an applet, I have changed the constructor to init, removed the setSize, setTitle calls... it's saying there's a Java IO access Permission error? I'll do a little more research and then post a new thread in applets. [ May 20, 2005: Message edited by: A Parent ]
subject: JButtons switching states(icons) too quickly