I recently made this program to count the seconds passing by but unfortunately, no print statement is showing. What is my problem here?
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import javax.swing.*;
class MizohSoftware extends JFrame {
private class TimerListener implements ActionListener {
public void actionPerformed(ActionEvent e) {
int time = 0;
int inc = 1;
time += inc;
System.out.println(time + "seconds has passed");
}
}
public void starttimer() {
int delay = 1000;
Timer display = new Timer(delay, new TimerListener());
display.start();
}
public static void main(String[] args) {
MizohSoftware MizohSoftware = new MizohSoftware();
MizohSoftware.starttimer();
}
}