Velocity Reviews

Velocity Reviews (http://www.velocityreviews.com/forums/index.php)
-   Java (http://www.velocityreviews.com/forums/f30-java.html)
-   -   stop org.jdesktop.application.Task started using @Action public Task (http://www.velocityreviews.com/forums/t614233-stop-org-jdesktop-application-task-started-using-action-public-task.html)

Mike 05-11-2008 11:01 PM

stop org.jdesktop.application.Task started using @Action public Task
 
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

GArlington 05-12-2008 12:09 PM

Re: stop org.jdesktop.application.Task started using @Action publicTask
 
On May 12, 12:01 am, Mike <darthvadertojabuahahah...@gmail.com> wrote:
> 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;"...


All times are GMT. The time now is 07:41 AM.

Powered by vBulletin®. Copyright ©2000 - 2014, vBulletin Solutions, Inc.
SEO by vBSEO ©2010, Crawlability, Inc.