Results 1 to 2 of 2
Thread: Halt applet processes.
- 04-06-2009, 03:38 PM #1
Member
- Join Date
- Feb 2009
- Posts
- 40
- Rep Power
- 0
Halt applet processes.
Small problem that is probably easy. If there is a process running in an applet which takes awhile to complete. is there a way i could halt the process, by clicking some gray space on my frame? is there anyway that this could be done. i've done some research on halting processes, but i haven't gotten any headway in this. if anyone could help please do.
thanks in advance.
Rusk
- 04-06-2009, 05:11 PM #2
A structure similar to this:
Clicking the button can then set stopped to true, allowing controlled termination of the process. If the computation you are doing cannot be characterised by some kind of loop then you just have to check it periodically. This is the simplest way of doing it, there are many ways to make it better, using different kinds of synchronisation and access patterns. If you want to return intermediate values, then use a SwingWorker.Java Code:public class Job extends Thread { volatile boolean stopped = false; public void run() { for (int i; i<lim; i++) { if (stopped) break; // do stuff } // clean up } }
Similar Threads
-
Too many java.exe processes due to netbeans
By abhishek.jain in forum NetBeansReplies: 7Last Post: 12-29-2009, 01:52 PM -
Calling another applet on click of button in one applet
By niteshwar.bhardwaj in forum Java 2DReplies: 1Last Post: 02-19-2009, 12:54 PM -
need applet help !
By fadiRU in forum Java AppletsReplies: 2Last Post: 02-08-2009, 02:29 AM -
netbeans processes don´t die
By karlen in forum NetBeansReplies: 0Last Post: 06-11-2007, 09:55 PM -
Applet, To center text and To open I engage in a dialog in an Applet
By Marcus in forum Java AppletsReplies: 4Last Post: 06-08-2007, 06:15 AM


LinkBack URL
About LinkBacks
Reply With Quote
Bookmarks