I want my timer to execute the actionPerformed method only one time once it 5 seconds the time but it is writing in the console \"Hello\" lots of times:
import j
class MyTask extends TimerTask { public void run() { System.out.println("Hello"); } }
and then
timer = new Timer(); timer.schedule(new MyTask(), 5000);