Forums Register Login

Exception with the Piece of Code

+Pie Number of slices to send: Send
I am a beginner in Multithreading and I have an issue with my very first Program. In the code given below, after Clicking START Button, thread starts to run and prints the label on the panel ,and On clicking STOP , it stops , but again when I click on START button , it is throwing IllegalThreadStateException, moreover if I use interrupt() in Stop , it is not stopping or nothing is happening in the code.


+Pie Number of slices to send: Send
Thread interrupt is not working the way you would expect it to.

Google for Java How to Interrupt a Thread
+Pie Number of slices to send: Send
Thanks for Thread Interrupt issue , but why the START button is throwing exception ?
+Pie Number of slices to send: Send
Because you cannot start a Thread twice.
+Pie Number of slices to send: Send
there are 2 commands called suspend and resume but those are depreciated , so is there no way to get my desired output?
She'll be back. I'm just gonna wait here. With this tiny ad:
a bit of art, as a gift, the permaculture playing cards
https://gardener-gift.com


reply
reply
This thread has been viewed 1027 times.
Similar Threads
Help designing a GUI
Sample maintenance disply
missing components
Implementing scanner into a simple login page
How to use getModel() with JTabbedPane ?
More...

All times above are in ranch (not your local) time.
The current ranch time is
Mar 28, 2024 07:46:15.