So I have googled some minutes how to use the timer and found some helpfull threads here. But when I want to use the suggested code Eclipse shows me always an error.
take a look at your imports. Eclipse has auto imported java.util.Timer. Change that to javax.swing.Timer and you should be on your way.
java.util.Timer
javax.swing.Timer