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
As already mentioned, it's better to use java.util.Timer, but you can also use setRepeats() before starting:
java.util.Timer
timer.setRepeats(false);