File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
Win a copy of Clojure in Action this week in the Clojure forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Exception with the Piece of Code

 
buntha Choudhary
Ranch Hand
Posts: 136
Android Eclipse IDE Windows XP
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.


 
Sebastian Janisch
Ranch Hand
Posts: 1183
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thread interrupt is not working the way you would expect it to.

Google for Java How to Interrupt a Thread
 
buntha Choudhary
Ranch Hand
Posts: 136
Android Eclipse IDE Windows XP
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks for Thread Interrupt issue , but why the START button is throwing exception ?
 
Sebastian Janisch
Ranch Hand
Posts: 1183
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Because you cannot start a Thread twice.
 
buntha Choudhary
Ranch Hand
Posts: 136
Android Eclipse IDE Windows XP
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
there are 2 commands called suspend and resume but those are depreciated , so is there no way to get my desired output?
 
I agree. Here's the link: http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic