I am new to java and have a swing task question.
Can I add a listener to a currently running task? For instance if something happens in doInBackGround I want to add a listener for finished and display a dialog. I have tried but the compiler doesnt like me. :)
Something like.
private class MyTask extends Task<Void, Void>{
@Override
public void doInBackground(){
if(foo == foo){
this.addTaskListener(new TaskListener() {
public void taskFinsished(){}...
});
}
}
}
Thanks