-1
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 her several times:
tempo1.schedule(tarefa1, 2000 );
Then to a longer time I’ll call her and give ERROR:
Exception in thread "AWT-Eventqueue-0" java.lang.Illegalstateexception: Task already scheduled or cancelled
I removed the other question
– Diogo Cipriano
Diogo sees a certain resistance of yours in relation to the construction of questions according to the site. Recreating a question will not cause you to get answers if the question does not conform to a pre established standard for the site. Take a little time and read [Ask] and [help/dont-Ask] and then edit your question according to the hints of these links. And at all times as possible, add a [mcve]. If you follow the tips of these links, your questions will improve in quality and the answers will come in the same proportion.
– user28595