Wrox Home  
Search P2P Archive for: Go

  Return to Index  

pro_java thread: Thread questions


Message #1 by "Cordell Bourne" <cbourne@c...> on Tue, 26 Jun 2001 00:23:59
I am just starting to learn about threads and have run into a problem.

I have a UI which starts up which allows a user to set some settings via 
checkboxs and list boxes etc.  When the user is done, the user can click a 
button to start a process.  What I am having a problem with in this 
scenario is once the process starts its takes over everthing and I would 
like to be able to allow the user to click a "Stop" button to stop the 
process.

I have read about Threads and somewhat understand what I have read.  Here 
are my classes

public class UI (this is my main class which starts up my UIFrame)
public class UIFrame (class for all my UI elements and from which the 
process starts running)
public class ProcessThread implements Runnable (Class for my process to 
run in which calls the main process handling class)
public class Process (Class to do what I need to have done)

The problem I am having is figuring out how to start the process thread 
and then poll the event queue to find out when the stop button is pressed. 

Any hints or suggestions?

  Return to Index