Right... I'm fairly new to java so this is probably pretty basic...
I'm trying to make a card game which uses swing components for the GUI. There are 3 computer players and after the player takes their turn each computer player plays in sequence. After the logic class plays the card I call a method in the view class which draws the last played card.
Naturally this all happens too fast for the player to see anything but the card played by the final player so I tried adding Thread.sleep(1000) to the program to slow things down. However the result is that the frame goes grey. I think that perhaps pausing the main thread means that the repaint method is not being called for too long. On the other hand I don't know anything about GUIs (they taught me Perl at uni...) so what do I know? :)
Does anyone have any suggestions for possible problems / fixes / reading i can do?
Thanks
I'm trying to make a card game which uses swing components for the GUI. There are 3 computer players and after the player takes their turn each computer player plays in sequence. After the logic class plays the card I call a method in the view class which draws the last played card.
Naturally this all happens too fast for the player to see anything but the card played by the final player so I tried adding Thread.sleep(1000) to the program to slow things down. However the result is that the frame goes grey. I think that perhaps pausing the main thread means that the repaint method is not being called for too long. On the other hand I don't know anything about GUIs (they taught me Perl at uni...) so what do I know? :)
Does anyone have any suggestions for possible problems / fixes / reading i can do?
Thanks
