Can somone help me count :D

Hi I was wondering if anyone knows how I can make a timer in the program that will count down or up from a entered number, Sort of like a stopwatch. I us JCreator if it makes a diffrence. I know some things about programming so all i need to know is if theres like a Math.counter() that i can use. I dont need a whole program written just a line or two or a link to a guide that can help me out. Thanks

Comments

  • : Hi I was wondering if anyone knows how I can make a timer in the
    : program that will count down or up from a entered number, Sort of
    : like a stopwatch. I us JCreator if it makes a diffrence. I know some
    : things about programming so all i need to know is if theres like a
    : Math.counter() that i can use. I dont need a whole program written
    : just a line or two or a link to a guide that can help me out. Thanks
    :
    I would implement a Runnable interface with inside the run() method a for loop. The code itself is then quite simple:
    [code]
    public void run() {
    for (int i = enteredNumber; i > 0; i--) {
    // A synchronized call to show output.
    // Some way to wait
    }
    }
    [/code]
Sign In or Register to comment.

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Categories

In this Discussion