Search:

Type: Posts; User: baddack

Search: Search took 0.07 seconds.

  1. Replies
    22
    Views
    4,700

    Re: Timer Countdown - Code Syntax

    Yeah, that was part of the problem too. I just completely redid it. Here is the code in case someone else is trying to do timers.


    //Create my timer
    private Timer timer;

    public Simulator()...
  2. Replies
    22
    Views
    4,700

    Re: Timer Countdown - Code Syntax

    Whelp, what a pain in the ass, but I fixed it. Thanks for the help. I had to create a new actionlistener and make my timer global and implement that actionlistener. That way it wasnt making a new...
  3. Replies
    22
    Views
    4,700

    Re: Timer Countdown - Code Syntax

    Everytime I press the keylistener '7', it gives me a different hashcode.
  4. Replies
    22
    Views
    4,700

    Re: Timer Countdown - Code Syntax

    Looks like from printing it all out, it is skipping my if(timer.isRunning()){ statement. So it is just always running the else statement and doing timer.start(). I'll see if I can fix this.
  5. Replies
    22
    Views
    4,700

    Re: Timer Countdown - Code Syntax

    Thanks Norm for all your help. I'll try printing it out and let you know what I find.
  6. Replies
    22
    Views
    4,700

    Re: Timer Countdown - Code Syntax

    Yeah, but I thought that using the Timer.Stop() would kill the first timer, but I don't think it does. This is where I am confused. My guess is that it just stops it (not killing it), so when the...
  7. Replies
    22
    Views
    4,700

    Re: Timer Countdown - Code Syntax

    When I press 7 multiple times, it resets the count to 5:00, but it starts to count down faster. It might not be noticeable with only a few presses, but if you press 7 like 10+ times, it starts...
  8. Replies
    22
    Views
    4,700

    Re: Timer Countdown - Code Syntax

    I don't use the images anymore (or buttons for that matter). If you run it, it's pretty simple and if you use the debug tool you can step through the code (which I have done). The problem is I must...
  9. Replies
    22
    Views
    4,700

    Re: Timer Countdown - Code Syntax

    import java.awt.*;
    import java.awt.datatransfer.StringSelection;
    import java.awt.event.*;
    import java.text.DecimalFormat;
    import java.util.ArrayList;
    import java.util.Random;
    import...
  10. Replies
    22
    Views
    4,700

    Re: Timer Countdown - Code Syntax

    Try this, let me know if it won't let you download. https://www.dropbox.com/s/af58zy14nchxgq5/ExampleTimerBroken.jar

    The program has a key listener, so when you press '7', it should start the...
  11. Replies
    22
    Views
    4,700

    Re: Timer Countdown - Code Syntax

    So I took your advice and scrapped my timer and implemented a javax.swing.Timer. However, I am having an issue with restarting it still. What I want to do is, the user presses a button and the...
  12. Replies
    22
    Views
    4,700

    Timer Countdown - Code Syntax

    Hello! I'm currently working on a program in my spare time for fun. In the program you can press a button, in which it will start a countdown. I've come up with a really sloppy way to do this and...
Results 1 to 12 of 12