multithreading - Having Some Problems with Threads on Java -


I've got this program of computing the primary numbers. When the stoppage is stopped, the program stops computing the major numbers, but when I go and press, I need the program to continue its computation, but I did not know that I myself How can I start yarn again? I tried to make it a new example but nothing happened here: My code is:

  PublicApp PrimeApp1 JFrame {JTextArea Output Protected; Protected pocket go; Protected Jebton Stop; Secured counter = 2; Protected boolean stop computation = false; Public boolean run = true; Protected Boolean isPrime (long number) {long max = (long) Math.sqrt (number) + 1; (Long I = 2; i   

}

I think your problem is That you are trying to start a thread that has already finished the process. You can start only one thread at a time, see for details.

Instead of going action to start the thread in the audience, you may want to create a new thread object that Akshnlistnr and start it

something like this:

  go.addActionListener (new Akshnlistr) (public void action executed (ActionEvent e) {PrintPrimes print = new Printprims (); print.start ();}});   

Instead of creating the last thread object in your constructor.

Comments

Popular posts from this blog

php - PDO bindParam() fatal error -

logging - How can I log both the Request.InputStream and Response.OutputStream traffic in my ASP.NET MVC3 Application for specific Actions? -

java - Why my included JSP file won't get processed correctly? -