Game timers and a "tick event"?

Im in the process of creating a small game in java, using the MVC pattern.  What I'm looking for is how would I go about adding a Clock/timer class into my game that would update the view every second?

At the moment the view updates as a user presses a button, though that wont work if the user doesn't press anything, I know if I was doing this in .Net I'd look to have a timer with an interval of 1 second and just say notifyobservers();  though I'm not sure how to do this in Java, particularly with the interval?
satoryAsked:
Who is Participating?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

x
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

frzsomborCommented:
Maybe you can try this:
  int delay = 1000; //milliseconds
  ActionListener taskPerformer = new ActionListener() {
      public void actionPerformed(ActionEvent evt) {
          //...Perform a task...
      }
  };
  new Timer(delay, taskPerformer).start();

Open in new window

frzsomborCommented:
Sorry, I've misunderstood your question. I thought that you want to delay something.

But now if I understand, you will need this:
http://ubuntuforums.org/showthread.php?t=1250479

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
satoryAuthor Commented:
Thanks I think that second one will be exactly what I need for what I want, thanks.
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Game Programming

From novice to tech pro — start learning today.