Wednesday, 11 September 2013

Closing all child threads when closing the stage/window

Closing all child threads when closing the stage/window

I have multiple instances of child threads which are started and should
continue to execute in till the applications exits.
I have classes which extends Task and I create the threads as
new Thread(object of the class).start();
when it comes to interrupting/stoping (dont know which one is correct,
please let me know) the threads which should be done inside
primaryStage.onCloseOperation(){}
here i want to end all child threads but since my threads are spreaded
across different classes, my not having a clear picture how to achieve
this.
I know there is some designing problem, in my application, when it comes
to threads, but I am not able to figure out how to resolve out.

No comments:

Post a Comment