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 01:38 AM.

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


1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57