Posted By:
bharani_iyer
Posted On:
Thursday, May 2, 2002 01:12 AM
Hello Yugandhar,
Create a class BkgrJob which implements the Runnable interface.
public class BkgrJob implements Runnable {
private methodProc() {
//do processing...
sendEmail();
}
private sendEmail() {
//...
}
public void run() {
methodProc();
}
}
Now from your GUI class, On button clicked instantiate a new BkgrJob object and invoke start() method as follows :
BkgrJob theObj = new BkgrJob();
theObj.start();
This would do the necessary background processing in a separate thread, while in the main thread the user could perform other navigation related activites.
Cheers,
bharani.