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()...
Type: Posts; User: baddack
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()...
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...
Everytime I press the keylistener '7', it gives me a different hashcode.
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.
Thanks Norm for all your help. I'll try printing it out and let you know what I find.
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...
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...
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...
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...
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...
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...
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...