tags:

views:

65

answers:

3

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

+3  A: 

Start it in another Thread
ref
example

org.life.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
is it possible to stop that thread by re clicking that button
raj
No. See here http://www.devx.com/tips/Tip/31728. When you later run into weird behaviour, read all about synchronization.
raoulsson