public class Control extends JFrame implements ActionListener {
javax.swing.Timer timer;
public Control () {
timer = new javax.swing.Timer (100, this);
}
public static void main(String[] args) {
new Control();
}
public void actionPerformed(ActionEvent e) {
if (e.getSource() == timer) {
//some method
}
if (e.getActionCommand().equals("Auto")) {
this.timer.start();
auto.setText ("Pause");
}
if (e.getActionCommand().equals("Pause")) {
this.timer.stop();
auto.setText ("Auto");
}
}
}
When I press the "Auto" button, the timer runs, but after one instance of the timer, it stops running and presents the follow error message: https://pastebin.com/ExtdqkGa