I have the following code\[code\]new Timer(300, this).start();\[/code\]and this\[code\]public void actionPerformed(ActionEvent e) { //do something}\[/code\]in the same class which implements \[code\]ActionListener\[/code\].The problem is that the program terminates before the code in \[code\]actionPerformed\[/code\] gets chance to run. At least I think that is what is happening!How do I tell java to keep running when it has nothing to do?Thanks!Edit: It's a javax.swing.Timer