I have the following task:
Timer tempovolta1 = new Timer();
TimerTask tarefavolta1 = new TimerTask() {
@Override
public void run() {
jButton1.setBackground(Color.BLUE);
}
};
I want to call you several times:
tempo1.schedule(tarefa1, 2000 );
After a while I'll call her and give ERROR :
Exception in thread "AWT-EventQueue-0" java.lang.IllegalStateException: Task already scheduled or canceled