Hi,
I have a main program in which I create five more threads. When these threads are created I show a Dialogbox with a ProgressBar for each of the threads status. Means if I have five threads I show five ProgressBars one for each thread that shoes the status of the threads completion. I also a Button that when clicked stops all the threads and closes the dialog box. But my problem is that when I click a Button the Dialogbox closes but the Threads still keep on running at the back. How can I kill or stop all the threads when a Button is clicked. I really apprecitae for any help. I tried to use Thread.stop() it does work but it's deprecated. I read the Docs. that say to use a variable and that when chages exits the run method. But I don't know how to incorporate this as I have five or more threads. I have a common run method and in that I am calling some other local methods too. I don't know how and where to set the boolean variable. Any small example will help alot or any tips.
Thanks
I have a main program in which I create five more threads. When these threads are created I show a Dialogbox with a ProgressBar for each of the threads status. Means if I have five threads I show five ProgressBars one for each thread that shoes the status of the threads completion. I also a Button that when clicked stops all the threads and closes the dialog box. But my problem is that when I click a Button the Dialogbox closes but the Threads still keep on running at the back. How can I kill or stop all the threads when a Button is clicked. I really apprecitae for any help. I tried to use Thread.stop() it does work but it's deprecated. I read the Docs. that say to use a variable and that when chages exits the run method. But I don't know how to incorporate this as I have five or more threads. I have a common run method and in that I am calling some other local methods too. I don't know how and where to set the boolean variable. Any small example will help alot or any tips.
Thanks