Trying to run side by side operations without interference
Okay, the title is obviously rather hard to understand, but I couldn't think of something more accurate. Now that that's out of the way, here's my problem:
I'm working on a game for java (in swing) for my final project (I'm in my first year of Programming) and I've run into a problem. I'm trying to make it so that I can basically perform multiple operations at once. Basically, I need a JButton to toggle between 2 colors every second without making it so that I can't do anything else, like click buttons. My best idea for delaying the color change would be Thread.sleep(), but doing that temporarily disables everything else. Suggestions?