stop org.jdesktop.application.Task started using @Action public Task

M

Mike

Hello
I am using org.jdesktop.application.Task from NetBeans 6 in my app.
I start Task with jButton using @Action:
@Action public Task startClusteringTask()
{
...
return myTask;
}

Is there any way to stop this task when it is running?
Thank you in advance
Mike
 
G

GArlington

Hello
I am using org.jdesktop.application.Task from NetBeans 6 in my app.
I start Task with jButton using @Action:
@Action public Task startClusteringTask()
{
...
return myTask;

}

Is there any way to stop this task when it is running?
Thank you in advance
Mike

Depending on your implementation of startClusteringTask() your task
will either stop when the method is finished, or [if you create a
separate thread for your "myTask"] it will continue running until you
quit the application unless you set a ref to the task somewhere in
your object.
You can use HashMap (or similar) and add a ref to your task as
myHashMap.add(myTask.name, myTask) just before "return myTask;"...
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,769
Messages
2,569,576
Members
45,054
Latest member
LucyCarper

Latest Threads

Top