hello, i need to start an crawl process on clicking a button if i write inside onclick the other tabs cant be accessible till the process stops i need to run the process in background.in java
A:
If you are using Swing then this might be useful
http://download.oracle.com/javase/6/docs/api/javax/swing/SwingWorker.html
+1
A:
Call another thread inside the "on click" callback, like this:
Thread t = new Thread(new Runnable() {
public void run() {
// your code
}
});
t.start();
raoulsson
2010-08-24 15:37:01
is it possible to stop that thread by re clicking that button
raj
2010-08-25 03:36:31
No. See here http://www.devx.com/tips/Tip/31728. When you later run into weird behaviour, read all about synchronization.
raoulsson
2010-08-25 07:12:25