I'm still new to java and followed tutorials online from multiple sites for a timer I want to make for my GUI program but I wanted to test out the timer on a standard loop first.
import javax.swing.*;
import java.awt.*;
class main {
public static void main(String Args[]) {
ActionListener changelight = new ActionListener();
int delay = 1000;
Timer timer = new Timer(delay, changelight);
timer.start();
}
public void actionPerformed(ActionEvent e) {
for (int a=0; a<=1000; a++) {
System.out.printf("%d \n", a);
}
return;
}
}
I can't seem to get it to run properly and hoping one of use can see why?
Thanks